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