[BUG] Conflict between the model file and sentencepiece

#8
by mayuyuace1 - opened

According to the issue: https://github.com/google/sentencepiece/issues/1308, sentencepiece 0.2.2 introduced a validation that rejects loading .model files containing pieces with null bytes (\x00).
But int the file https://huggingface.co/OpenGVLab/InternVL2-2B/blob/main/tokenizer.model, the standard <0x00> byte fallback token exists at index 3.
A error will be raise as below reproducer show:

/*******************************/

pip install sentencepiece==0.2.2

import sentencepiece as spm

sp = spm.SentencePieceProcessor()
sp.Load("/path/to/tokenizer.model")

RuntimeError: INTERNAL: piece must not include null character.

/*******************************/
Sentencepiece claims that this is an inspection procedure that is correct and in line with expectations.
Can you help fix the bug?

Sign up or log in to comment