m-ric HF staff commited on
Commit
c9b1b1f
1 Parent(s): fb66618

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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>Probability</b></th>
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>"""