You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from peft import PeftModel, PeftConfig
from transformers import AutoModel, AutoTokenizer
import torch
# Load configuration and model
peft_model_id = "./DeepSeek-R1-bf16-lora/lora"
peft_config = PeftConfig.from_pretrained(peft_model_id, trust_remote_code=True)
base_model = AutoModel.from_pretrained(peft_config.base_model_name_or_path, trust_remote_code=True)
# Load the model with LoRA parameters
model = PeftModel.from_pretrained(base_model, peft_model_id)
# Merge LoRA weights into the base model
model = model.merge_and_unload()
# Now, 'model' contains the merged weights and can be used for inference or saved as a new model
model.save_pretrained("./model_merge")
Our machine has 2TB of memory, The swap space is 2TB, and we have attempted to merge the LoRA weights, but it reported missing weights. There are over 1000 layers of weights missing after merging the LoRA weights compared to before..
after DeepSeek 671B Fine-Tuning , how to load the Original model and lora model to test ?
help ~
The text was updated successfully, but these errors were encountered: