Replies: 2 comments 5 replies
-
@6nl Could you please share the colab notebook that is working for this issue. |
Beta Was this translation helpful? Give feedback.
-
Here is the monkey patch that got it working for me. I can set forced_decoder_ids in the generate call now. The issue was that in the huggingface transformers code, to force a token they set the scores for all tokens to -tf.float(inf) and then update the score for the forced token to 0, so it gets chosen. But in tflite the -inf value sometimes gets rounded and ends up as a NaN. Its the closest value to a overflow error that you can get. So I just replaced it with -1 as it is still less than 0. Include the cell below before your generate call.
|
Beta Was this translation helpful? Give feedback.
-
Hi, thanks so much for his repo Niranjan! I am doing a project on top of it, and so I really appreciate what you've done here.
My project involves translation, not transcription. So I need to set prompts. I have been struggling to get the tflite model to generate any useful output at all when I include prompts. It generates tokens of value zero. I think this might be an issue you have had too, judging by the issue you raised here: huggingface/transformers#19691 (comment)
After days of tracing, I have a fix, if it's still a problem for you.
Beta Was this translation helpful? Give feedback.
All reactions