Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -144,7 +144,7 @@ def generate_markdown_table(scores, top_k=4, chosen_tokens=None):
|
|
144 |
<table>
|
145 |
<tr>
|
146 |
<th><b>Token</b></th>
|
147 |
-
<th><b>
|
148 |
</tr>"""
|
149 |
for token_idx in np.argsort(scores)[-top_k:]:
|
150 |
token = tokenizer.decode([token_idx])
|
@@ -154,7 +154,7 @@ def generate_markdown_table(scores, top_k=4, chosen_tokens=None):
|
|
154 |
markdown_table += f"""
|
155 |
<tr style={style}>
|
156 |
<td>{token}</td>
|
157 |
-
<td>{scores[token_idx]}</td>
|
158 |
</tr>"""
|
159 |
markdown_table += """
|
160 |
</table>"""
|
|
|
144 |
<table>
|
145 |
<tr>
|
146 |
<th><b>Token</b></th>
|
147 |
+
<th><b>Score</b></th>
|
148 |
</tr>"""
|
149 |
for token_idx in np.argsort(scores)[-top_k:]:
|
150 |
token = tokenizer.decode([token_idx])
|
|
|
154 |
markdown_table += f"""
|
155 |
<tr style={style}>
|
156 |
<td>{token}</td>
|
157 |
+
<td>{scores[token_idx]:.4f}</td>
|
158 |
</tr>"""
|
159 |
markdown_table += """
|
160 |
</table>"""
|