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