Skip to content

Misc. bug: Qwen3VL Convert HF to GGUF "tokenizer.model" not found #18065

Closed

Description

@phr00t

Name and Version

$ ./llama-cli --version
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 4080 Laptop GPU, compute capability 8.9, VMM: yes
load_backend: loaded CUDA backend from D:\llama.cpp.python\ggml-cuda.dll
load_backend: loaded RPC backend from D:\llama.cpp.python\ggml-rpc.dll
load_backend: loaded CPU backend from D:\llama.cpp.python\ggml-cpu-alderlake.dll
version: 7406 (4aced7a)
built with Clang 19.1.5 for Windows x86_64

Operating systems

Windows

Which llama.cpp modules do you know to be affected?

Python/Bash scripts

Command line

python convert_hf_to_gguf.py q3-vl-h --outtype bf16 --outfile q3-vl-h-bf16.gguf

Problem description & steps to reproduce

Latest pull as of this post.

Trying to convert this model: https://huggingface.co/coder3101/Qwen3-VL-32B-Instruct-heretic-v2/tree/main

Transformers v4.57.3, pytorch 2.9.1+cu130

Getting errors when trying to convert from HF to GGUF, see log. Says a "tokenizers.model" file cannot be found, but no file exists (nor base model has it).

First Bad Commit

No response

Relevant log output

$ python convert_hf_to_gguf.py q3-vl-h --outtype bf16 --outfile q3-vl-h-bf16.gguf
INFO:hf-to-gguf:Loading model: q3-vl-h
INFO:hf-to-gguf:Model architecture: Qwen3VLForConditionalGeneration
INFO:hf-to-gguf:gguf: loading model weight map from 'model.safetensors.index.json'
INFO:hf-to-gguf:gguf: indexing model part 'model-00001-of-00002.safetensors'
INFO:hf-to-gguf:gguf: indexing model part 'model-00002-of-00002.safetensors'
INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only
INFO:hf-to-gguf:Exporting model...
INFO:hf-to-gguf:output.weight,             torch.bfloat16 --> BF16, shape = {5120, 151936}
INFO:hf-to-gguf:token_embd.weight,         torch.bfloat16 --> BF16, shape = {5120, 151936}
...
INFO:hf-to-gguf:output_norm.weight,        torch.bfloat16 --> F32, shape = {5120}
INFO:hf-to-gguf:Set meta model
INFO:hf-to-gguf:Set model parameters
INFO:hf-to-gguf:gguf: context length = 262144
INFO:hf-to-gguf:gguf: embedding length = 5120
INFO:hf-to-gguf:gguf: feed forward length = 25600
INFO:hf-to-gguf:gguf: head count = 64
INFO:hf-to-gguf:gguf: key-value head count = 8
INFO:hf-to-gguf:gguf: rms norm epsilon = 1e-06
INFO:hf-to-gguf:gguf: file type = 32
INFO:hf-to-gguf:MRoPE sections: [24, 20, 20, 0]
INFO:hf-to-gguf:Set model quantization version
INFO:hf-to-gguf:Set model tokenizer
Traceback (most recent call last):
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 3410, in set_vocab
    self._set_vocab_sentencepiece()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 1299, in _set_vocab_sentencepiece
    tokens, scores, toktypes = self._create_vocab_sentencepiece()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 1316, in _create_vocab_sentencepiece
    raise FileNotFoundError(f"File not found: {tokenizer_path}")
FileNotFoundError: File not found: q3-vl-h\tokenizer.model

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 10560, in <module>
    main()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 10554, in main
    model_instance.write()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 680, in write
    self.prepare_metadata(vocab_only=False)
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 804, in prepare_metadata
    self.set_vocab()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 4149, in set_vocab
    super().set_vocab()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 3412, in set_vocab
    self._set_vocab_gpt2()
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 1235, in _set_vocab_gpt2
    tokens, toktypes, tokpre = self.get_vocab_base()
                               ^^^^^^^^^^^^^^^^^^^^^
  File "D:\llama.cpp.python\convert_hf_to_gguf.py", line 940, in get_vocab_base
    tokenizer = AutoTokenizer.from_pretrained(self.dir_model)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\models\auto\tokenization_auto.py", line 1156, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\tokenization_utils_base.py", line 2113, in from_pretrained
    return cls._from_pretrained(
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\tokenization_utils_base.py", line 2359, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\models\qwen2\tokenization_qwen2_fast.py", line 120, in __init__
    super().__init__(
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\tokenization_utils_fast.py", line 178, in __init__
    super().__init__(**kwargs)
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\tokenization_utils_base.py", line 1472, in __init__
    self._set_model_specific_special_tokens(special_tokens=self.extra_special_tokens)
  File "C:\Users\Phr00t\AppData\Roaming\Python\Python312\site-packages\transformers\tokenization_utils_base.py", line 1210, in _set_model_specific_special_tokens
    self.SPECIAL_TOKENS_ATTRIBUTES = self.SPECIAL_TOKENS_ATTRIBUTES + list(special_tokens.keys())
                                                                           ^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'keys'

Activity

  1. CISC commented on Dec 15, 2025

    @CISC
    Member

    The tokenizer.model error is not the actual error, you just see it because you get a full traceback. What happens after it can't find that file is that it uses AutoTokenizer from transformers, and it is in fact this that fails (the last error you get), so something is wrong with that model's tokenizer_config.json, or there is some kind of regression in the version of transformers you have installed.

    This is what is causing the error (extra_special_tokens is expected to be a dictionary, not a list):
    https://huggingface.co/coder3101/Qwen3-VL-32B-Instruct-heretic-v2/blob/main/tokenizer_config.json#L9-L23

  2. phr00t commented on Dec 15, 2025

    @phr00t
    Author

    Thank you. I will let the model author know. I am using the base model's tokenizer files instead, and it seems to be working (creating a GGUF anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions