1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #375] Backend tokenizer failure #195

Closed
opened 2026-11-01 04:18:31 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @fukc-gihtub on GitHub (Jun 11, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/375

Running heretic google/gemma-4-12B-it-qat-q4_0-gguf from a fresh Python 3.14 venv with heretic installed (master branch, pip install git+https://github.com/p-e-w/heretic) I'm getting

ValueError: Couldn't instantiate the backend tokenizer from one of: 
(1) a `tokenizers` library serialization file, 
(2) a slow tokenizer instance to convert or 
(3) an equivalent slow tokenizer class to instantiate and convert. 
You need to have sentencepiece or tiktoken installed to convert a slow tokenizer to a fast one.

After installing both sentencepiece and tiktoken, the issue isn't resolved.

pip list
Package                Version
---------------------- -----------
absl-py                2.4.0  
accelerate             1.14.0
aiohappyeyeballs       2.6.2  
aiohttp                3.14.1
aiosignal              1.4.0
alembic                1.18.4
annotated-doc          0.0.4
annotated-types        0.7.0 
anyio                  4.13.0
attrs                  26.1.0
bitsandbytes           0.49.2
certifi                2026.5.20
chardet                6.0.0.post1
charset-normalizer     3.4.7
click                  8.4.1 
colorama               0.4.6 
colorlog               6.10.1
cuda-bindings          13.3.1
cuda-pathfinder        1.5.5 
cuda-toolkit           13.0.2
DataProperty           1.1.1                                      
datasets               4.8.5
dill                   0.4.1 
evaluate               0.4.6
filelock               3.29.3
frozenlist             1.8.0   
fsspec                 2026.2.0
greenlet               3.5.1 
h11                    0.16.0
heretic-llm            1.3.0
hf-xet                 1.5.1
httpcore               1.0.9
httpx                  0.28.1
huggingface_hub        1.19.0
idna                   3.18  
immutabledict          4.3.1
Jinja2                 3.1.6 
joblib                 1.5.3 
kernels                0.12.3
langdetect             1.0.9 
lm_eval                0.4.12
lxml                   6.1.1 
Mako                   1.3.12
markdown-it-py         4.2.0
MarkupSafe             3.0.3 
mbstrdecoder           1.1.5 
mdurl                  0.1.2
more-itertools         11.1.0
mpmath                 1.3.0 
multidict              6.7.1 
multiprocess           0.70.19
narwhals               2.22.1
networkx               3.6.1 
nltk                   3.9.4 
numpy                  2.4.6
nvidia-cublas          13.1.1.3
nvidia-cuda-cupti      13.0.85
nvidia-cuda-nvrtc      13.0.88
nvidia-cuda-runtime    13.0.96
nvidia-cudnn-cu13      9.20.0.48
nvidia-cufft           12.0.0.61                                  
nvidia-cufile          1.15.1.6
nvidia-curand          10.4.0.35
nvidia-cusolver        12.0.4.66
nvidia-cusparse        12.6.3.3
nvidia-cusparselt-cu13 0.8.1
nvidia-nccl-cu13       2.29.7
nvidia-nvjitlink       13.0.88
nvidia-nvshmem-cu13    3.4.5
nvidia-nvtx            13.0.85
optuna                 4.9.0
packaging              26.2
pandas                 3.0.3
pathvalidate           3.3.1
peft                   0.19.1
pip                    26.0.1
portalocker            3.2.0
prompt_toolkit         3.0.52
propcache              0.5.2
psutil                 7.2.2
py-cpuinfo             9.0.0
pyarrow                24.0.0
pydantic               2.13.4
pydantic_core          2.46.4
pydantic-settings      2.14.1
Pygments               2.20.0
pytablewriter          1.2.1
python-dateutil        2.9.0.post0
python-dotenv          1.2.2
pytz                   2026.2
PyYAML                 6.0.3
questionary            2.1.1
regex                  2026.5.9
requests               2.34.2
rich                   14.3.4
rouge_score            0.1.2
sacrebleu              2.6.0
safetensors            0.8.0
scikit-learn           1.9.0
scipy                  1.17.1
sentencepiece          0.2.1
setuptools             81.0.0
shellingham            1.5.4
six                    1.17.0
SQLAlchemy             2.0.50
sqlitedict             2.1.0
sympy                  1.14.0
tabledata              1.3.5
tabulate               0.10.0
tcolorpy               0.1.7
threadpoolctl          3.6.0
tiktoken               0.13.0
tokenizers             0.22.2
tomli_w                1.2.0
torch                  2.12.0
tqdm                   4.68.2
transformers           5.11.0
triton                 3.7.0
typepy                 1.3.5
typer                  0.25.1
typing_extensions      4.15.0
typing-inspection      0.4.2
urllib3                2.7.0
wcwidth                0.8.1
word2number            1.1
xxhash                 3.7.0
yarl                   1.24.2
Originally created by @fukc-gihtub on GitHub (Jun 11, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/375 Running `heretic google/gemma-4-12B-it-qat-q4_0-gguf` from a fresh Python 3.14 venv with heretic installed (master branch, `pip install git+https://github.com/p-e-w/heretic`) I'm getting ``` ValueError: Couldn't instantiate the backend tokenizer from one of: (1) a `tokenizers` library serialization file, (2) a slow tokenizer instance to convert or (3) an equivalent slow tokenizer class to instantiate and convert. You need to have sentencepiece or tiktoken installed to convert a slow tokenizer to a fast one. ``` After installing both `sentencepiece` and `tiktoken`, the issue isn't resolved. <details> <summary>pip list</summary> <pre> Package Version ---------------------- ----------- absl-py 2.4.0 accelerate 1.14.0 aiohappyeyeballs 2.6.2 aiohttp 3.14.1 aiosignal 1.4.0 alembic 1.18.4 annotated-doc 0.0.4 annotated-types 0.7.0 anyio 4.13.0 attrs 26.1.0 bitsandbytes 0.49.2 certifi 2026.5.20 chardet 6.0.0.post1 charset-normalizer 3.4.7 click 8.4.1 colorama 0.4.6 colorlog 6.10.1 cuda-bindings 13.3.1 cuda-pathfinder 1.5.5 cuda-toolkit 13.0.2 DataProperty 1.1.1 datasets 4.8.5 dill 0.4.1 evaluate 0.4.6 filelock 3.29.3 frozenlist 1.8.0 fsspec 2026.2.0 greenlet 3.5.1 h11 0.16.0 heretic-llm 1.3.0 hf-xet 1.5.1 httpcore 1.0.9 httpx 0.28.1 huggingface_hub 1.19.0 idna 3.18 immutabledict 4.3.1 Jinja2 3.1.6 joblib 1.5.3 kernels 0.12.3 langdetect 1.0.9 lm_eval 0.4.12 lxml 6.1.1 Mako 1.3.12 markdown-it-py 4.2.0 MarkupSafe 3.0.3 mbstrdecoder 1.1.5 mdurl 0.1.2 more-itertools 11.1.0 mpmath 1.3.0 multidict 6.7.1 multiprocess 0.70.19 narwhals 2.22.1 networkx 3.6.1 nltk 3.9.4 numpy 2.4.6 nvidia-cublas 13.1.1.3 nvidia-cuda-cupti 13.0.85 nvidia-cuda-nvrtc 13.0.88 nvidia-cuda-runtime 13.0.96 nvidia-cudnn-cu13 9.20.0.48 nvidia-cufft 12.0.0.61 nvidia-cufile 1.15.1.6 nvidia-curand 10.4.0.35 nvidia-cusolver 12.0.4.66 nvidia-cusparse 12.6.3.3 nvidia-cusparselt-cu13 0.8.1 nvidia-nccl-cu13 2.29.7 nvidia-nvjitlink 13.0.88 nvidia-nvshmem-cu13 3.4.5 nvidia-nvtx 13.0.85 optuna 4.9.0 packaging 26.2 pandas 3.0.3 pathvalidate 3.3.1 peft 0.19.1 pip 26.0.1 portalocker 3.2.0 prompt_toolkit 3.0.52 propcache 0.5.2 psutil 7.2.2 py-cpuinfo 9.0.0 pyarrow 24.0.0 pydantic 2.13.4 pydantic_core 2.46.4 pydantic-settings 2.14.1 Pygments 2.20.0 pytablewriter 1.2.1 python-dateutil 2.9.0.post0 python-dotenv 1.2.2 pytz 2026.2 PyYAML 6.0.3 questionary 2.1.1 regex 2026.5.9 requests 2.34.2 rich 14.3.4 rouge_score 0.1.2 sacrebleu 2.6.0 safetensors 0.8.0 scikit-learn 1.9.0 scipy 1.17.1 sentencepiece 0.2.1 setuptools 81.0.0 shellingham 1.5.4 six 1.17.0 SQLAlchemy 2.0.50 sqlitedict 2.1.0 sympy 1.14.0 tabledata 1.3.5 tabulate 0.10.0 tcolorpy 0.1.7 threadpoolctl 3.6.0 tiktoken 0.13.0 tokenizers 0.22.2 tomli_w 1.2.0 torch 2.12.0 tqdm 4.68.2 transformers 5.11.0 triton 3.7.0 typepy 1.3.5 typer 0.25.1 typing_extensions 4.15.0 typing-inspection 0.4.2 urllib3 2.7.0 wcwidth 0.8.1 word2number 1.1 xxhash 3.7.0 yarl 1.24.2 </pre> </details>
Author
Owner

@kabachuha commented on GitHub (Jun 11, 2026):

You need to run it on the original .safetensors repository, not on the .gguf quants

<!-- gh-comment-id:4682822751 --> @kabachuha commented on GitHub (Jun 11, 2026): You need to run it on the original .safetensors repository, not on the .gguf quants
Author
Owner

@fukc-gihtub commented on GitHub (Jun 11, 2026):

I thought heretic supported quantized models? From the README:

While PyTorch 2.2 is the minimum version of PyTorch needed for Heretic to work, some models and configurations might require features only found in later versions. For example, loading MXFP4-quantized models like gpt-oss uses torch.accelerator, which was added in PyTorch 2.6.

<!-- gh-comment-id:4682864922 --> @fukc-gihtub commented on GitHub (Jun 11, 2026): I thought heretic supported quantized models? From the README: > While PyTorch 2.2 is the minimum version of PyTorch needed for Heretic to work, some models and configurations might require features only found in later versions. For example, loading MXFP4-quantized models like gpt-oss uses torch.accelerator, which was added in PyTorch 2.6.
Author
Owner

@umran666 commented on GitHub (Jun 12, 2026):

I thought heretic supported quantized models? From the README:

While PyTorch 2.2 is the minimum version of PyTorch needed for Heretic to work, some models and configurations might require features only found in later versions. For example, loading MXFP4-quantized models like gpt-oss uses torch.accelerator, which was added in PyTorch 2.6.

The README is talking about standard Hugging Face quantized formats (like MXFP4 or bitsandbytes 4-bit/8-bit QLoRA) that support PyTorch autograd.
You need to run Heretic on the standard safetensors base model repo (like google/gemma-4-12b-it).

<!-- gh-comment-id:4686931000 --> @umran666 commented on GitHub (Jun 12, 2026): > I thought heretic supported quantized models? From the README: > > > While PyTorch 2.2 is the minimum version of PyTorch needed for Heretic to work, some models and configurations might require features only found in later versions. For example, loading MXFP4-quantized models like gpt-oss uses torch.accelerator, which was added in PyTorch 2.6. The README is talking about standard Hugging Face quantized formats (like MXFP4 or bitsandbytes 4-bit/8-bit QLoRA) that support PyTorch autograd. You need to run Heretic on the standard safetensors base model repo (like google/gemma-4-12b-it).
Author
Owner

@fukc-gihtub commented on GitHub (Jun 12, 2026):

Okay, thanks.

<!-- gh-comment-id:4687027293 --> @fukc-gihtub commented on GitHub (Jun 12, 2026): Okay, thanks.
Author
Owner

@p-e-w commented on GitHub (Jun 12, 2026):

We don't need autograd (except in ARA), but we do need basic tensor operations, which PyTorch doesn't support for most of the quantized types in GGUF containers.

Even some non-GGUF formats like FP8 are not supported for this reason.

<!-- gh-comment-id:4689422672 --> @p-e-w commented on GitHub (Jun 12, 2026): We don't need autograd (except in ARA), but we do need basic tensor operations, which PyTorch doesn't support for most of the quantized types in GGUF containers. Even some non-GGUF formats like FP8 are not supported for this reason.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#195
No description provided.