-
Notifications
You must be signed in to change notification settings - Fork 2k
Check if past_key_values is provided when using prefix_tuning in peft_model #1942
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
Conversation
I'm not sure if I add the unit test file test_past_kv.py in the correct place, so if there's any problem please let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for providing this fix so quickly. I have a few comments, please take a look.
merge upstream commits
…nto check_past_kv merge origin commit
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Thanks for the updates @Nidhogg-lyz, could you please run |
@BenjaminBossan I've already run
For
|
What is your ruff version? Try 0.4.10. |
Done! My original version of |
The errors for MacOS on CI seem to be unrelated to this PR:
I will investigate further and come back to this PR afterwards. Edit: Sorry, I was mistaken, it's not unrelated. @Nidhogg-lyz could you please remove the usage of float16 from the test? |
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fix.
There was an error with prefix tuning when some models like Llava passed past_key_values explicitly, even if it was None, because it resulted in that argument passed twice (once explicit, once via kwargs). This is now fixed.
Fix TypeError
object got multiple values for keyword argument 'past_key_values'
whenpast_key_values
is provided in base_model'sforward
call in Prefix Tuning. Resolves #1938 .