Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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
|
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 |
|