Repository navigation
eos_token_id for Phi-3 when using builder script
#1052
Replies: 2 comments
|
Previously, having a list of token ids in the However, reverting this change will not fix this issue for the Phi-3 model family. The EOS token id to store in the From our testing, however, we observed several possible EOS token ids with the Phi-3 model family: |
|
Thanks for the reply Having looked again, it seems like if the model we are trying to convert contains |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If using the builder script to convert a Phi-3 model into ONNX format for use with ONNX Runtime GenAI, the value for
eos_token_idingenai_config.jsonis 32000, corresponding to<|endoftext|>. However, for themicrosoft/Phi-3-mini-4k-instruct-onnxmodel in Hugging Face, the value foreos_token_idis an array:[32000, 32001, 32007], corresponding to<|endoftext|>,<|assistant|>and<|end|>.This difference caused us issues, as we converted a fine-tuned model into ONNX format to use with ONNX Runtime GenAI, and were confused as to why the model continued to generate output endlessly. It took a while to realise that the model was outputting
<|end|>, but because we had"eos_token_id": 32000, the generation would never stop.I see that
"eos_token_id": 32000is coming directly from thetransformerslibrary, but would be good to know what can be done about this, or if we should simply always manually updategenai_config.jsonto add these additional values.All reactions