Suggested tokenizer changes similar to Phi-4

#8
by l2dy - opened

tokenizer_config.json for Phi-4-mini-instruct also contains the following,

  "bos_token": "<|endoftext|>",
  "eos_token": "<|endoftext|>",
  "pad_token": "<|endoftext|>",

which was changed in Phi-4 to use different strings. https://huggingface.co/microsoft/phi-4/commit/6fbb3d3bbe726c99b4188087b4deeec1bceac5ae

Does it make sense to apply similar changes to Phi-4-mini-instruct?

I have applied the Unsloth fixes when creating the gguf files here : https://huggingface.co/Mungert/Phi-4-mini-instruct.gguf . And it seems to perform better than the original. Not benchmarked its just what I found when testing function calls during development. So I would go ahead and try the fixes on this version.

I have applied the Unsloth fixes when creating the gguf files here : https://huggingface.co/Mungert/Phi-4-mini-instruct.gguf . And it seems to perform better than the original. Not benchmarked its just what I found when testing function calls during development. So I would go ahead and try the fixes on this version.

Note that the pipeline() calls don't work with the fixed tokenizer but I guess it's not a base model so it cannot be used for text completion

I have only tested using llama.cpp and gguf so I don't know about potential pipeline() issues. If you do use Unsloth bug fixes then be sure to use their latest version as this "eos_token": "<|endoftext|>" had been left, incorrect, by mistake in previous version. Should be "eos_token": "<|end|>". Files that have this incorrect : special_tokens_map.json, config.json, generation_config.json and tokenizer_config.json. Or use this as your base https://huggingface.co/unsloth/Phi-4-mini-instruct/tree/main it now has the correct EOS.

Sign up or log in to comment