m-ric HF staff commited on
Commit
0033238
β€’
1 Parent(s): db8fd68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -441,7 +441,7 @@ def get_beam_search_html(
441
  # Sequences are padded anyway so you can batch decode them
442
  decoded_sequences = tokenizer.batch_decode(outputs.sequences)
443
 
444
- sequence_scores = (outputs.sequences_scores if n_beams > 1 else outputs.scores)
445
  for i, sequence in enumerate(decoded_sequences):
446
  markdown += f"\n- Score `{sequence_scores[i]:.2f}`: `{clean(sequence.replace('<s> ', ''))}`"
447
 
 
441
  # Sequences are padded anyway so you can batch decode them
442
  decoded_sequences = tokenizer.batch_decode(outputs.sequences)
443
 
444
+ sequence_scores = (outputs.sequences_scores if number_beams > 1 else outputs.scores)
445
  for i, sequence in enumerate(decoded_sequences):
446
  markdown += f"\n- Score `{sequence_scores[i]:.2f}`: `{clean(sequence.replace('<s> ', ''))}`"
447