I resolved it by following below steps:-
-
push adapter weights(from trainer)
trainer.push_to_hub(“your_huggingface_dir”) -
push the base model as well
base_model.push_to_hub(“your_huggingface_dir”) -
then loading the model with:
model_finetuned = AutoModelForCausalLM.from_pretrained(
finetuned_model_name,
device_map=“auto”,
torch_dtype=torch.bfloat16
)