Skip to content

[convert-hf] Fix exception in sentencepiece with added tokens#6320

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
pcuenca:sentence-piece-added-tokens
Mar 26, 2024
Merged

[convert-hf] Fix exception in sentencepiece with added tokens#6320
ggerganov merged 1 commit intoggml-org:masterfrom
pcuenca:sentence-piece-added-tokens

Conversation

@pcuenca
Copy link
Copy Markdown
Contributor

@pcuenca pcuenca commented Mar 26, 2024

When adding new tokens present in added_tokens.json, the loop went out of bounds of the sentencepiece vocab, because the new tokens have not been added yet but the model's vocabulary report the total. This change first loops through the tokenizer tokens, then adds the new ones. It also verifies that the totals match.

@ggerganov ggerganov merged commit e097633 into ggml-org:master Mar 26, 2024
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 3, 2024
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
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