convert : register Qwen 3.5 ForCausalLM for text only#20119
Merged
Conversation
danbev
approved these changes
Mar 5, 2026
Member
danbev
left a comment
There was a problem hiding this comment.
This does fix the reported issue but the conversion fails with the following error for me:
Traceback (most recent call last):
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 12130, in <module>
main()
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 12124, in main
model_instance.write()
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 716, in write
self.prepare_metadata(vocab_only=False)
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 857, in prepare_metadata
self.set_vocab()
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 829, in set_vocab
self._set_vocab_gpt2()
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 1336, in _set_vocab_gpt2
tokens, toktypes, tokpre = self.get_vocab_base()
^^^^^^^^^^^^^^^^^^^^^
File "/home/danbev/work/ai/llama.cpp/examples/model-conversion/../../convert_hf_to_gguf.py", line 1005, in get_vocab_base
tokenizer = AutoTokenizer.from_pretrained(self.dir_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/danbev/work/ai/llama.cpp/venv/lib/python3.11/site-packages/transformers/models/auto/tokenization_auto.py", line 1153, in from_pretrained
raise ValueError(
ValueError: Tokenizer class TokenizersBackend does not exist or is not currently imported.
make: *** [Makefile:41: causal-convert-model] Error 1But this looks like a custom class and with the following the conversion worked:
diff --git a/tokenizer_config.json b/tokenizer_config.json
index 6be6ce1..a5adeb7 100644
--- a/tokenizer_config.json
+++ b/tokenizer_config.json
@@ -23,7 +23,7 @@
"pad_token": "<|endoftext|>",
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
"split_special_tokens": false,
- "tokenizer_class": "TokenizersBackend",
+ "tokenizer_class": "Qwen2TokenizerFast",
"unk_token": null,
"video_token": "<|video_pad|>",
"vision_bos_token": "<|vision_start|>",
Member
Author
Thanks for testing! :) I think this is a new class in Edit: Not sure about the validity of using it like that, but seen it before, also a bit strange with the |
bartowski1182
pushed a commit
to bartowski1182/llama.cpp
that referenced
this pull request
Mar 10, 2026
Ethan-a2
pushed a commit
to Ethan-a2/llama.cpp
that referenced
this pull request
Mar 20, 2026
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.
Support text only versions of Qwen 3.5.
Fixes #20116
Fixes #20102