AnswerDotAI / fsdp_qlora

Training LLMs with QLoRA + FSDP
Apache License 2.0
1.42k stars 188 forks source link

How to load the saved model? #48

Open bilalghanem opened 6 months ago

bilalghanem commented 6 months ago

Hi

I need your help with loading the model. I see how you're doing that in the "converting..." file. But this is only for LORA models. What about full_shard models? (--sharding_strategy full_shard --train_type full).

I tried to load it this way but it didn't work:

model = AutoModelForCausalLM.from_pretrained(model_name).to("cuda")
model.load_state_dict(torch.load('model_state_dict.safetensors'))