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

Generate/load Encoder from tokenizer.json file #40

Open
michalblaha opened this issue Jul 9, 2024 · 1 comment · May be fixed by #41
Open

Generate/load Encoder from tokenizer.json file #40

michalblaha opened this issue Jul 9, 2024 · 1 comment · May be fixed by #41

Comments

@michalblaha
Copy link

What would you like to be added:

It would be great to generate/load encoder from tokenizer.json file like
https://huggingface.co/CohereForAI/aya-101/resolve/main/tokenizer.json
or
https://huggingface.co/openai-community/gpt2/raw/main/tokenizer.json

Why is this needed:

Easy use of specific tokenizer for specific (mostly open source) models

Anything else we need to know?

@HavenDV HavenDV linked a pull request Jul 10, 2024 that will close this issue
@HavenDV
Copy link
Contributor

HavenDV commented Jul 10, 2024

I started working on this, but ran into a series of difficulties:

  • Tiktoken files are initially designed to work with Regex, which is not defined in this file. I'm trying to generate them from Vocab, but it doesn't work with the compiled regex. And for a regular replacement by key, instead of regex, we need to change the Core part of the library.
  • When deserializing json, for some reason, model.merges and added_tokens are empty.
  • If we try to work with the generated regex, there is a problem with spaces

I'm a little out of context now, the bulk of the work on this library was done over a year ago, but I'd be glad for any help.

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 a pull request may close this issue.

2 participants