m-ric HF staff commited on
Commit
66e4ecd
β€’
1 Parent(s): bdb89ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -156,7 +156,7 @@ def generate_markdown_table(scores, top_k=4, chosen_tokens=None):
156
  return markdown_table
157
 
158
 
159
- def display_tree(scores, sequences, beam_indices):
160
  display = """<div class="container">
161
  <div class="tree">
162
  <ul>"""
@@ -184,7 +184,7 @@ def display_tree(scores, sequences, beam_indices):
184
 
185
  current_tree = current_tree["children"][current_token_choice]
186
 
187
- display += generate_html("Today is", original_tree)
188
 
189
  display += """
190
  </ul>
@@ -210,6 +210,7 @@ def get_tables(input_text, number_steps, number_beams):
210
  )
211
 
212
  tables = display_tree(
 
213
  outputs.scores,
214
  outputs.sequences[:, len(inputs) :],
215
  outputs.beam_indices[:, : -len(inputs)],
 
156
  return markdown_table
157
 
158
 
159
+ def display_tree(start_sentence, scores, sequences, beam_indices):
160
  display = """<div class="container">
161
  <div class="tree">
162
  <ul>"""
 
184
 
185
  current_tree = current_tree["children"][current_token_choice]
186
 
187
+ display += generate_html(start_sentence, original_tree)
188
 
189
  display += """
190
  </ul>
 
210
  )
211
 
212
  tables = display_tree(
213
+ input_text,
214
  outputs.scores,
215
  outputs.sequences[:, len(inputs) :],
216
  outputs.beam_indices[:, : -len(inputs)],