FIX: Change check if past_key_values is empty#2106
Merged
BenjaminBossan merged 3 commits intohuggingface:mainfrom Sep 27, 2024
Merged
FIX: Change check if past_key_values is empty#2106BenjaminBossan merged 3 commits intohuggingface:mainfrom
BenjaminBossan merged 3 commits intohuggingface:mainfrom
Conversation
After transformers merged this PR: huggingface/transformers#33703 The bool of past_key_values (a Cache instance) would change from False to True in one of our checks. Use get_seq_length() method instead, which is consistent before and after that commit. I checked the tests with the new change for both transformers before and after that commit and they passed, so this change should be backwards compatible.
|
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. |
This should be addressed in a separate PR. Marking it to xfail for now to get the original fix through CI.
Member
Author
|
@zucchini-nlp Could you please review? You can ignore the test that's being skipped, it's unrelated and will be treated in a separate PR. |
zucchini-nlp
approved these changes
Sep 27, 2024
Member
zucchini-nlp
left a comment
There was a problem hiding this comment.
LGTM! We don't usually check for bool existence of cache object, but I will check why it was False before. Unless it was None before, in which case it is expected if there is not cache at all
Member
Author
|
Thanks for the review @zucchini-nlp. I gave you write access to the repo as otherwise, your review was not deemed sufficient by GitHub to allow me to merge :D |
BenjaminBossan
added a commit
to BenjaminBossan/peft
that referenced
this pull request
Oct 1, 2024
After transformers merged this PR: huggingface/transformers#33703 The bool of past_key_values (a Cache instance) would change from False to True in one of our checks. Use get_seq_length() method instead, which is consistent before and after that commit. I checked the tests with the new change for both transformers before and after that commit and they passed, so this change should be backwards compatible. Unrelated change: Mark X-LoRA scaling test as xfail-ing for now. This should be addressed in a separate PR. Marking it to xfail for now to get the original fix through CI.
BenjaminBossan
added a commit
to BenjaminBossan/peft
that referenced
this pull request
Oct 22, 2024
After transformers merged this PR: huggingface/transformers#33703 The bool of past_key_values (a Cache instance) would change from False to True in one of our checks. Use get_seq_length() method instead, which is consistent before and after that commit. I checked the tests with the new change for both transformers before and after that commit and they passed, so this change should be backwards compatible. Unrelated change: Mark X-LoRA scaling test as xfail-ing for now. This should be addressed in a separate PR. Marking it to xfail for now to get the original fix through CI.
Guy-Bilitski
pushed a commit
to Guy-Bilitski/peft
that referenced
this pull request
May 13, 2025
After transformers merged this PR: huggingface/transformers#33703 The bool of past_key_values (a Cache instance) would change from False to True in one of our checks. Use get_seq_length() method instead, which is consistent before and after that commit. I checked the tests with the new change for both transformers before and after that commit and they passed, so this change should be backwards compatible. Unrelated change: Mark X-LoRA scaling test as xfail-ing for now. This should be addressed in a separate PR. Marking it to xfail for now to get the original fix through CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After transformers merged this PR:
huggingface/transformers#33703
The bool of
past_key_values(aCacheinstance) would change fromFalsetoTruein one of our checks:peft/src/peft/peft_model.py
Line 1779 in ccc3501
Use
get_seq_length()method instead, which is consistent before and after that commit.I checked the tests with the new change for both transformers before and after that commit and they passed, so this change should be backwards compatible.