mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
[docs] Correct the statement in the docstirng of compute_transition_scores in generation/utils.py (#28786)
This commit is contained in:
parent
4735866141
commit
7b2bd1fbbd
@ -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%
|
||||
|
Loading…
Reference in New Issue
Block a user