Skip to content

Fix HFTransformers recipe for kv-cache #2155

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

Closed
wants to merge 9 commits into from
Closed

Conversation

KaelanDt
Copy link
Contributor

@KaelanDt KaelanDt commented May 30, 2025

Before submitting
  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

This fixes an issue when trying to use the HFTransformers recipe when using HF kv-caching option (use_cache=True). The use of partial freezes the model, so history is still set to none when the cache is passed on the next iteration, so the test added in this PR was failing.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link
Collaborator

@t-vi t-vi left a comment

Choose a reason for hiding this comment

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

Thank you @KaelanDt @k223kim
If it works. Of course, with each iteration, we should probably look at adding a comment (I'm guilty of it, too) describing the magic...

@KaelanDt KaelanDt closed this Jun 2, 2025
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.

3 participants