Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,18 +34,32 @@ def create_interface():
|
|
34 |
# Combine all chart and explanation outputs into a list of components
|
35 |
dynamic_outputs = outputs[3:]
|
36 |
|
37 |
-
#
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
gr.
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
input_file.upload(
|
46 |
fn=process_and_update,
|
47 |
inputs=[input_file],
|
48 |
-
outputs=
|
49 |
)
|
50 |
|
51 |
return iface
|
|
|
34 |
# Combine all chart and explanation outputs into a list of components
|
35 |
dynamic_outputs = outputs[3:]
|
36 |
|
37 |
+
# Create a list of Gradio components for the dynamic outputs
|
38 |
+
dynamic_components = []
|
39 |
+
for output in dynamic_outputs:
|
40 |
+
if isinstance(output, gr.components.Plot):
|
41 |
+
dynamic_components.append(gr.Plot())
|
42 |
+
elif isinstance(output, gr.components.Textbox):
|
43 |
+
dynamic_components.append(gr.Textbox())
|
44 |
+
|
45 |
+
# Return all outputs
|
46 |
+
return [status, exec_time, lang] + dynamic_outputs
|
47 |
+
|
48 |
+
# Define the outputs for the interface
|
49 |
+
outputs = [
|
50 |
+
status_text,
|
51 |
+
execution_time,
|
52 |
+
detected_language,
|
53 |
+
]
|
54 |
+
# Add dynamic output components
|
55 |
+
for _ in range(6): # Assuming maximum 2 speakers and 3 analysis types
|
56 |
+
outputs.append(gr.Plot())
|
57 |
+
outputs.append(gr.Textbox())
|
58 |
|
59 |
input_file.upload(
|
60 |
fn=process_and_update,
|
61 |
inputs=[input_file],
|
62 |
+
outputs=outputs
|
63 |
)
|
64 |
|
65 |
return iface
|