Closed c-pupil closed 3 months ago
会自动冻结。
lora 推理不合并权重的话,类似这样加载即可。
model = LlamaForCausalLM.from_pretrained(
base_model,
load_in_8bit=load_8bit,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(
model,
lora_weights,
torch_dtype=torch.float16,
)
您好,首先感谢您出色的工作和讲解,另外我有下面的问题希望您可以解惑: 我自己从本地中加载已训练好的模型
请问在训练的过程中
mode.train()
之后不在target_modules的其他层的权重会自动冻结么,还有这个保存权重和推理时adapter以及在pth中冻结的权重如何加载。是通过以下方式么(PeftModel.from_pretrained是会将pth中微调的权重自动覆盖掉是么)如果能得到您的回复将不胜感激。