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

Cache: models return input cache type #30716

Merged
merged 1 commit into from
May 8, 2024
Merged

Conversation

gante
Copy link
Member

@gante gante commented May 8, 2024

What does this PR do?

Changes the Cache compatible models to return the same type of cache as the cache passed through past_key_values. This was not happening in the case a DynamicCache was explicitly passed as input, which was breaking a test :)

@gante
Copy link
Member Author

gante commented May 8, 2024

@zucchini-nlp this was the issue you pointed me to yesterday 🤗

@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It overall a clean fix. I think we deprecated the legacy cache so at some point we can just return whatever was given!

Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks a lot for standardizing this!

@gante
Copy link
Member Author

gante commented May 8, 2024

I think we deprecated the legacy cache so at some point we can just return whatever was given!

@ArthurZucker generate still defaults to the legacy format -- I'm going to rectify this 😉

@gante gante merged commit f26e407 into huggingface:main May 8, 2024
22 checks passed
@gante gante deleted the return_same branch May 8, 2024 17:26
@gante gante restored the return_same branch May 8, 2024 17:26
@gante gante deleted the return_same branch May 8, 2024 17:26
@ArthurZucker ArthurZucker mentioned this pull request May 9, 2024
4 tasks
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 10, 2024
itazap pushed a commit that referenced this pull request May 14, 2024
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.

None yet

4 participants