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

Fix tokenizer files search on HunggingFace #1618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maikereis
Copy link

Fix: Tokenizer File Search When Loading Models from Hugging Face

The previous implementation only searched for tokenizer files (tokenizer_config.json, tokenizer.json, and special_tokens_map.json) if the model name pointed to a local directory. This meant that when loading a model from Hugging Face, the tokenizer files were not properly searched for or loaded. As a result, the chat_template from a locally saved tokenizer would load successfully, but the same would fail for models downloaded from Hugging Face.

This fix ensures that tokenizer files are searched for both locally and on Hugging Face. Now, the chat_template and other tokenizer configurations will load correctly regardless of whether the model is loaded from a local directory or Hugging Face.

@danielhanchen
Copy link
Contributor

Thanks - sorry on the delay! @Erland366 Could you help review this PR - thanks in advance :)

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 this pull request may close these issues.

2 participants