Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,9 @@ def create_interface():
|
|
45 |
charts_and_explanations.append(gr.Textbox(visible=False))
|
46 |
|
47 |
def process_and_update(input_file):
|
|
|
|
|
|
|
48 |
# Process the input
|
49 |
results = process_input(input_file, progress=gr.Progress())
|
50 |
|
@@ -52,7 +55,7 @@ def create_interface():
|
|
52 |
return update_visibility_and_charts(*results)
|
53 |
|
54 |
def use_example_video():
|
55 |
-
return
|
56 |
|
57 |
input_file.upload(
|
58 |
fn=process_and_update,
|
@@ -63,7 +66,7 @@ def create_interface():
|
|
63 |
example_button.click(
|
64 |
fn=use_example_video,
|
65 |
inputs=[],
|
66 |
-
outputs=
|
67 |
).then(
|
68 |
fn=process_and_update,
|
69 |
inputs=[input_file],
|
@@ -76,4 +79,4 @@ iface = create_interface()
|
|
76 |
|
77 |
# Launch the app
|
78 |
if __name__ == "__main__":
|
79 |
-
iface.launch()
|
|
|
45 |
charts_and_explanations.append(gr.Textbox(visible=False))
|
46 |
|
47 |
def process_and_update(input_file):
|
48 |
+
if input_file is None:
|
49 |
+
return [gr.update(value="No file selected")] + [gr.update(visible=False)] * (len(charts_and_explanations) + 2)
|
50 |
+
|
51 |
# Process the input
|
52 |
results = process_input(input_file, progress=gr.Progress())
|
53 |
|
|
|
55 |
return update_visibility_and_charts(*results)
|
56 |
|
57 |
def use_example_video():
|
58 |
+
return example_video_path
|
59 |
|
60 |
input_file.upload(
|
61 |
fn=process_and_update,
|
|
|
66 |
example_button.click(
|
67 |
fn=use_example_video,
|
68 |
inputs=[],
|
69 |
+
outputs=input_file
|
70 |
).then(
|
71 |
fn=process_and_update,
|
72 |
inputs=[input_file],
|
|
|
79 |
|
80 |
# Launch the app
|
81 |
if __name__ == "__main__":
|
82 |
+
iface.launch(share=True)
|