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

py : handle byte tokens in get_token_type #5341

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

ggerganov
Copy link
Owner

Continuation of #5084

Fix #5064

@felladrin Could you give this branch another test and see if it works?

@felladrin
Copy link
Contributor

Alright, I'll be free to do the test in a few hours.

ℹ️ Info in case someone wants to test it before me: I'll be using the same model as before (Locutusque/TinyMistral-248M-v2.5). The reason for choosing this is that it's a small Mistral model that uses the Llama2 tokenizer and which repository doesn't have the tokenizer.model & added_tokens.json files.

convert.py Outdated Show resolved Hide resolved
Copy link
Contributor

@felladrin felladrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested it and it's working great! 🎉

Command:

llama.cpp/main -m model/ggml-model-f32.gguf -p "Building a website can be done in 10 simple steps:\nStep 1:" -n 64 -e --repeat_penalty 1.1 -c 0 --temp 0

Output (without the changes from this PR):

Building a website can be done in 10 simple steps:<0x0A>Step 1: Create a new website<0x0A>- Start by creating a new website.<0x0A>- Add the necessary HTML and CSS to style the website.<0x0A>- Use CSS to style the website, including changing the font, font, and color scheme.<0x0A>- Choose a webpage with the following links for the website you want to create a

Output (with the changes from this PR):

Building a website can be done in 10 simple steps:
Step 1: Create a new website
- Start by creating a new website.
- Add the necessary HTML and CSS to style the website.
- Use CSS to style the website, including changing the font, font, and color scheme.
- Choose a webpage with the following links for the website you want to create a

@ggerganov ggerganov merged commit 906cff5 into master Feb 6, 2024
24 of 26 checks passed
jordankanter pushed a commit to jordankanter/llama.cpp that referenced this pull request Mar 13, 2024
* py : handle byte tokens in `get_token_type`

* py : fix empty bytes arg
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
* py : handle byte tokens in `get_token_type`

* py : fix empty bytes arg
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.

convert.py --vocab-type hfft produces <0x0A> instead of new lines
3 participants