Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,12 +39,12 @@ def update_max_index(score_option, output_option):
|
|
| 39 |
return gr.Slider(maximum=max_index), gr.Number(value=0, maximum=max_index)
|
| 40 |
|
| 41 |
|
| 42 |
-
def parse_notebook(
|
| 43 |
reset_tmp_folder()
|
| 44 |
if output_options == "All":
|
| 45 |
-
sample = ds[i]
|
| 46 |
else:
|
| 47 |
-
sample = ds_out[i]
|
| 48 |
|
| 49 |
notebook_string = sample["text"]
|
| 50 |
notebook_id = sample["id"].split("/")[-1]
|
|
@@ -83,7 +83,7 @@ with gr.Blocks() as demo:
|
|
| 83 |
outputs=[index_slider, index_slider]
|
| 84 |
)
|
| 85 |
|
| 86 |
-
index_slider.change(fn=parse_notebook, inputs=[
|
| 87 |
-
demo.load(fn=parse_notebook, inputs=[
|
| 88 |
|
| 89 |
demo.launch()
|
|
|
|
| 39 |
return gr.Slider(maximum=max_index), gr.Number(value=0, maximum=max_index)
|
| 40 |
|
| 41 |
|
| 42 |
+
def parse_notebook(score_options, output_options, index):
|
| 43 |
reset_tmp_folder()
|
| 44 |
if output_options == "All":
|
| 45 |
+
sample = ds[score_options][i]
|
| 46 |
else:
|
| 47 |
+
sample = ds_out[score_options][i]
|
| 48 |
|
| 49 |
notebook_string = sample["text"]
|
| 50 |
notebook_id = sample["id"].split("/")[-1]
|
|
|
|
| 83 |
outputs=[index_slider, index_slider]
|
| 84 |
)
|
| 85 |
|
| 86 |
+
index_slider.change(fn=parse_notebook, inputs=[score_options, output_options, index_slider], outputs=[html, file])
|
| 87 |
+
demo.load(fn=parse_notebook, inputs=[score_options, output_options, index_slider], outputs=[html, file])
|
| 88 |
|
| 89 |
demo.launch()
|