Skip to content
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

Update guidance with the mode of PEFT #656

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

HelloWorldLTY
Copy link

Hi, I notice that the function of PEFT is still under construction. Therefore, I update guidance with PEFT. Could you please review this code and merge it? Thanks.

@slundberg
Copy link
Collaborator

@HelloWorldLTY thanks, this looks great! Can you add at least one unit test to make sure this continues to work in the future? Thanks.

@HelloWorldLTY
Copy link
Author

Sure, I will do that asap. Thanks.

@HelloWorldLTY
Copy link
Author

Hi, I have added a unit test known as test_peft.py file. I did not test inference since it required extra files. Do I need to handle other conflict files? Thanks.

@slundberg
Copy link
Collaborator

Thanks. The test currently just tests the HF code though not the new changes here :)

Also looking through this again I realized I think this also works right?

pmodel = PeftModel.from_pretrained(model, peft_model_id)
guidance.models.Transformers(pmodel, tokenizer)

If so that is probably the best way to handle this since other wise we are just rewrapping the PeftModel.from_pretrained constructor.

@HelloWorldLTY
Copy link
Author

I think so, this is anothe alternative approach. Moreover, installing peft is still the required step I think. Do I need to modify the readme file to implement your suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants