-
Notifications
You must be signed in to change notification settings - Fork 27k
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
[Mistral] Mistral-7B-v0.1 support #26447
Conversation
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.
Just left 2 nits, thanks a lot for opening the PR and adding this model to transformers!
Regarding the CIs, pip install -e ".[quality"
should make sure you have the correct versioning to run make style
and make fixup
. The hub test is flaky
Mistral-7B-v0.1 is a decoder-based LM with the following architectural choices: | ||
* Sliding Window Attention - Trained with 8k context length and fixed cache size, with a theoretical attention span of 128K tokens | ||
* GQA (Grouped Query Attention) - allowing faster inference and lower cache size. | ||
* Byte-fallback BPE tokenizer - ensures that characters are never mapped to out of vocabulary tokens. | ||
|
||
We also provide an instruction fine-tuned model: `Mistral-7B-Instruct-v0.1` which can be used for chat-based inference. |
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.
Would be awesome to have more details about the model directly here like the data it was trained on, but it's a nit!
|
||
class MistralAttention(nn.Module): | ||
""" | ||
Multi-headed attention from 'Attention Is All You Need' paper. Modified to use sliding window attention |
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.
Last nit, is there a link to a doc/article/blog where the window attention is introduced? 🤗
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.
Done :)
Failing test is expected, you can add the failed on setup with "worker 'gw0' crashed while running 'src/transformers/models/mistral/configuration_mistral.py::transformers.models.mistral.configuration_mistral.MistralConfig'"
worker 'gw0' crashed while running 'src/transformers/models/mistral/configuration_mistral.py::transformers.models.mistral.configuration_mistral.MistralConfig' is just from trying to init a too big model for the runner! (Llama also had this issue) |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
* [Mistral] Mistral-7B-v0.1 support * fixing names * slightly longer test * fixups * not_doctested * wrongly formatted references * make fixuped --------- Co-authored-by: Timothee Lacroix <t@eugen.ai> Co-authored-by: timlacroix <t@mistral.ai>
* [Mistral] Mistral-7B-v0.1 support * fixing names * slightly longer test * fixups * not_doctested * wrongly formatted references * make fixuped --------- Co-authored-by: Timothee Lacroix <t@eugen.ai> Co-authored-by: timlacroix <t@mistral.ai>
What does this PR do?
Support for Mistral 7B models
Fixes # (issue)
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.