[Mistral] Move MistralConverter into integrations/mistral/ package - #46603
Conversation
000d773 to
ca2d153
Compare
|
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. |
ArthurZucker
left a comment
There was a problem hiding this comment.
Ty! Have 1 small nit
f23ce60 to
675280e
Compare
|
Thank you for your contribution 🤗! CI Security Gate — automatic approval blockedThis PR was not automatically approved for CI because the security gate failed. Possible reasons:
See the workflow run for the exact violations. A maintainer can review and manually approve CI if a finding is a false positive. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: afmoe, aimv2, albert, align, altclip, apertus, arcee, aria, audio_spectrogram_transformer, audioflamingo3, auto, autoformer, aya_vision, bamba, bark, bart |
3440908 to
f3bd1d9
Compare
|
@ArthurZucker hopefully i answered to your comments 😄 |
f3bd1d9 to
87f2b6d
Compare
| return instance | ||
|
|
||
| @staticmethod | ||
| def _extract_merges(bpe_ranks: dict[bytes, int]) -> tuple[dict[str, int], list[tuple[str, str]]]: |
There was a problem hiding this comment.
copy of TikTokenConverter.extract_vocab_merges_from_model (https://github.com/juliendenize/transformers/blob/b4765e266167036650168e1baaadfd2ce1138a6c/src/transformers/convert_slow_tokenizer.py#L1921) so maybe we should actually have this as a top-level function in convert_slow_tokenizer.py that can be imported by both MistralConverter and TikTokenConverter.
I can do this in a follow up PR though, to keep this one mistral-only
There was a problem hiding this comment.
makes sense, think it would be better in a follow up as well for the reason you invoked
…rd mistral-common import
CI recapDashboard: View test results in Grafana |
…uggingface#46603) * [Mistral] Move MistralConverter into integrations/mistral/ package * refactor: make MistralConverter constructible from vocab_file and guard mistral-common import
…uggingface#46603) * [Mistral] Move MistralConverter into integrations/mistral/ package * refactor: make MistralConverter constructible from vocab_file and guard mistral-common import
What does this PR do?
from_tekken_file(), which pre-computes the vocab and merges in a single pass.rank, independent of list ordering.skip_special_tokens=True.Tested with
RUN_SLOW=1 pytest tests/integrations/mistral/test_tokenizer.py→ 22 passed (incl. slow tests downloadingtekken.jsonfrommistralai/Ministral-3-3B-Instruct-2512and mistral-common cross-backend equivalence).Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.
PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.
This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read
CONTRIBUTING.md.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.
tokenizers: @ArthurZucker and @itazap