

TITLE
How to print out the probability for each bean search result in gpt2 text generator?

COMMENTS
2

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 0

BODY
# 🚀 I want to see the probability for the text result generated by gpt2 model 
<!-- A clear and concise description of the feature proposal.
     Please provide a link to the paper and code in case they exist. -->


See a sample code as below, when we used a pre-trained model,  can we also print out the probability outcome with each beam_output? 

beam_outputs = model.generate(
    input_ids, 
    max_length=50, 
    num_beams=5, 
    no_repeat_ngram_size=2, 
    num_return_sequences=5, 
    early_stopping=True
)

for i, beam_output in enumerate(beam_outputs):
  **print("{}: {}".format(i, tokenizer.decode(beam_output, skip_special_tokens=True)))**


<!-- Please outline the motivation for the proposal. Is your feature request
     related to a problem? e.g., I'm always frustrated when [...]. If this is related
     to another GitHub issue, please link here too. -->



<!-- Is there any way that you could help, e.g. by submitting a PR?
     Make sure to read the CONTRIBUTING.MD readme:
     https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md -->
