Closed vicaranq closed 5 months ago
Solved:
from peft import PeftModel
model = MplugOwlForConditionalGeneration.from_pretrained(
pretrained_ckpt,
torch_dtype=torch.bfloat16
).to(device)
m = PeftModel.from_pretrained(model, lora_adapters_path)
model = m.merge_and_unload()
I am trying to finetune the pretrained model version with new data. It now runs successfully creating mlflow experiments and the output folder files. However, I have not found a way to use the finetuned model.
This is a similar issue to #87 and #118 but my checkpoint folder does not contain the pytorch_model.bin, so now I am having issues when trying to
model.load_state_dict(prefix_state_dict)
. I am following the suggestions on the issues I mentioned and my code is:The output folder structure is:
I get an error on the last line,
model.load_state_dict(prefix_state_dict)
:which I think confirms that I am using the wrong lora_path, but I don't see the
pytorch_model.bin
file. Does anyone have any insight on what may be happening or how I could load the new finetune model if I don't have the pytorch_model.bin file?