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: |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply Having looked again, it seems like if the model we are trying to convert contains |
Beta Was this translation helpful? Give feedback.
-
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_id
ingenai_config.json
is 32000, corresponding to<|endoftext|>
. However, for themicrosoft/Phi-3-mini-4k-instruct-onnx
model in Hugging Face, the value foreos_token_id
is 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": 32000
is coming directly from thetransformers
library, but would be good to know what can be done about this, or if we should simply always manually updategenai_config.json
to add these additional values.Beta Was this translation helpful? Give feedback.
All reactions