-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do I need to report the model file in bin format during the training process? #61
Comments
Hello, @ScottishFold007, could you provide the minimal training code and the training setup such as how many GPUs. - unwrapped_model.save_pretrained() For saving and loading, please use the new cool HF hub utils from main branch:
Please refer this notebook for an end-to-end example: https://github.com/huggingface/peft/blob/main/examples/conditional_generation/peft_lora_seq2seq.ipynb |
Thank you very much, I solved this problem with your guidance!
***@***.***
From: Sourab Mangrulkar
Date: 2023-02-09 13:04
To: huggingface/peft
CC: Scottish_Fold007; Mention
Subject: Re: [huggingface/peft] Do I need to report the model file in bin format during the training process? (Issue #61)
Hello, @ScottishFold007, could you provide the minimal training code and the training setup such as how many GPUs.
When saving a model trained using PEFT, you don't need to save the entire model, i.e., remove the below line:
- unwrapped_model.save_pretrained()
For saving and loading, please use the new cool HF hub utils from main branch:
Install from main branch:
pip install git+https://github.com/huggingface/peft.git
Saving PEFT model:
peft_model_id = f"/root/gaochangkuan_AI/PromptCLUE_Finetuning/model_finetuning_1_epoch/"
model.save_pretrained(peft_model_id)
Loading PEFT model for inference:
from peft import PeftModel, PeftConfig
peft_model_id = f"/root/gaochangkuan_AI/PromptCLUE_Finetuning/model_finetuning_1_epoch/"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(config.base_model_name_or_path)
model = PeftModel.from_pretrained(model, peft_model_id)
Please refer this notebook for an end-to-end example: https://github.com/huggingface/peft/blob/main/examples/conditional_generation/peft_lora_seq2seq.ipynb
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Do I need to keep the model file in bin format when training the model with peft at that time? I saved it and used it in combination with the 'lora.pt' file and found that the model generation was poor and did not make much sense.
This is my infering code:
Note:The model file in "model_finetuning_1_epoch" is saved during training, not the initial model.
So, where might the problem lie?
The text was updated successfully, but these errors were encountered: