Spaces:
Sleeping
Sleeping
Example of how to use the trained model
#2
by
spookyspookanon
- opened
This seems rather useful however I'm not up to date on this specific topic, therefore it would extremely helpful if there were a minimal example of how to use the model after it's downloaded. Thank you.
Thank you for your attention on our work. After your downlowd and unzip the peft model example_lora
, you may try these codes.
from peft import PeftModel, PeftConfig
peft_model_id = f"example_lora"
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)
You may turn to https://github.com/huggingface/peft/blob/main/examples/conditional_generation/peft_lora_seq2seq.ipynb for other details. The downloaded files can be used as the result of model.save_pretrained(peft_model_id)
in peft
let me know if you meet other questions!