Unverified Commit 7b2bd1fb authored by Shichao Song's avatar Shichao Song Committed by GitHub
Browse files

[docs] Correct the statement in the docstirng of compute_transition_scores in...

[docs] Correct the statement in the docstirng of compute_transition_scores in generation/utils.py (#28786)
parent 47358661
......@@ -968,7 +968,7 @@ class GenerationMixin:
>>> input_length = 1 if model.config.is_encoder_decoder else inputs.input_ids.shape[1]
>>> generated_tokens = outputs.sequences[:, input_length:]
>>> for tok, score in zip(generated_tokens[0], transition_scores[0]):
... # | token | token string | logits | probability
... # | token | token string | log probability | probability
... print(f"| {tok:5d} | {tokenizer.decode(tok):8s} | {score.numpy():.3f} | {np.exp(score.numpy()):.2%}")
| 262 | the | -1.414 | 24.33%
| 1110 | day | -2.609 | 7.36%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment