Add probabilities for generated text in inference model#163
Add probabilities for generated text in inference model#163allen-q wants to merge 1 commit intotensorflow:masterfrom
Conversation
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
Close this pull request in favour of #164 as I used an incorrect email address in a commit of this branch. |
Background:
I was using the T5 model and wanted to get the probabilities at inference mode along with the generated text. However, this feature is not supported by T5 at the moment and I was advised to implement this feature and raise a pull request.
This PR implemented this function to add the probabilities along the generated text in the outputs when a model is exported in SavedModel format.
Changed file:
./mesh/mesh_tensorflow/transformer/utils.py
SignatureDef Diff
Below is how a T5 MTF SavedModel SignatureDef looks like before the change:
Below is how a T5 MTF SavedModel SignatureDef looks like after the change: