Changed convert-pt-to-ggml.py to use .tiktoken tokenizer files#725
Merged
ggerganov merged 1 commit intoggml-org:masterfrom Apr 14, 2023
Merged
Changed convert-pt-to-ggml.py to use .tiktoken tokenizer files#725ggerganov merged 1 commit intoggml-org:masterfrom
ggerganov merged 1 commit intoggml-org:masterfrom
Conversation
ggerganov
approved these changes
Apr 14, 2023
Member
ggerganov
left a comment
There was a problem hiding this comment.
Tested with medium and it produces the same model as before.
Thank you very much!
jacobwu-b
pushed a commit
to jacobwu-b/Transcriptify-by-whisper.cpp
that referenced
this pull request
Oct 24, 2023
jacobwu-b
pushed a commit
to jacobwu-b/Transcriptify-by-whisper.cpp
that referenced
this pull request
Oct 24, 2023
landtanin
pushed a commit
to landtanin/whisper.cpp
that referenced
this pull request
Dec 16, 2023
iThalay
pushed a commit
to iThalay/whisper.cpp
that referenced
this pull request
Sep 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes my issue #724
Changed the way vocabulary is read and converted to ggml. Used the same code as in original tiktoken library.
The resulting ggml files are the same as ones downloaded from huggingface. For multilingual exactly the same, for en only there is a difference of 17 bytes, due to the difference in whisper's vocab files.
In the old vocab.json there are 50257 tokens, the last one
<|endoftext|>with index 50256. In the new gpt2.tiktoken there are only 50256 tokens, the endoftext is removed. 4 bytes for the int storing string length + 13 bytes for the string itself = 17 byte difference. It doesn't seem to make a difference in the model output anyway, not sure why this token was in the vocab.json previously, since it is probably a special token.I have only tested with tiny models, but the only change is in the tokenizer so it should work for all the others.