-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Fix crash when executing MambaCache sample code #40557
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
Fix crash when executing MambaCache sample code #40557
Conversation
20e4166
to
5b1c9c1
Compare
cc @gante @zucchini-nlp since this is based on cache updates |
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. |
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.
Thank you for opening the PR and fixing the docs 🤗
Added a few minor corrections to make them flawless
>>> cache_position = torch.arange(len(inputs["input_ids"][0]), device=model.device) # sequence length | ||
>>> outputs = model(**inputs, cache_params=cache_params, cache_position=cache_position, use_cache=True) | ||
>>> outputs.cache_params | ||
FalconMambaCache() |
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.
(this is not the output, let's remove this line too)
>>> cache_position = torch.arange(len(inputs["input_ids"][0]), device=model.device) # sequence length | ||
>>> outputs = model(**inputs, cache_params=cache_params, cache_position=cache_position, use_cache=True) | ||
>>> outputs.cache_params | ||
MambaCache() |
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.
(same comment here)
4ef40ff
to
18df233
Compare
18df233
to
8a979c1
Compare
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.
Thank you for iterating and helping us make the library better 🤗
[For maintainers] Suggested jobs to run (before merge) run-slow: falcon_mamba, mamba |
Thanks for following up! |
* Fix the sample code of MambaCache * Update automatically generated code * Fix FalconMambaCache documents * minor doc fixes --------- Co-authored-by: Joao Gante <joao@huggingface.co>
What does this PR do?
This PR updates the obsolete sample code of
MambaCache
that does not work.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.