I have investigated how model and tokenizer files are represented and how to work with them in practice. My notes cover a protobuf tokenizer format whose specification I could not find, my recommendation to use a Python tokenization library, and a video about inspecting GGUF embeddings with gguflib.c and Redis. These format explorations sit alongside my work with gguf models in mlx and my notes on embedding models and file formats.
I found that tokenizer.model files in torch LLM distributions are protobuf files.
I can't find the specification of that file.
When I inspected the files with protoc --decode_raw, I found that the fields shown by "protoc --decode_raw" are not the same for all items.
I thought the format was more convoluted than expected.
I recommended that it's better to use the Python library to perform the tokenization.
I shared a new English-language video titled “Inspecting LLM embeddings in GGUF format with gguflib.c and Redis.”
I shared the video at https://t.co/q2kvRBZcxy.