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

Update app.py

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