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

Mistral's tokenizer is not optimized #134

Open
Yarflam opened this issue Mar 13, 2024 · 0 comments
Open

Mistral's tokenizer is not optimized #134

Yarflam opened this issue Mar 13, 2024 · 0 comments

Comments

@Yarflam
Copy link

Yarflam commented Mar 13, 2024

Hello!

How to reproduce:

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('mistralai/Mistral-7B-Instruct-v0.2')

tokenizer.add_bos_token = False
tokenizer.add_eos_token = False

ids = [ 12866, 601 ] # "▁domestic" + "ated"
decode = tokenizer.decode(ids)
encode = tokenizer.encode(decode)
print(encode)
# output -> [2853, 374, 6899] 
# "▁dom" + "est" + "icated"

I don't know what's the best thing to do and if this case has an impact on the calculation.
It's just a feedback - but I'm sure it's possible to find another cases.

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

No branches or pull requests

1 participant