Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,31 +16,23 @@ def create_interface():
|
|
16 |
execution_time = gr.Textbox(label="Execution Time", visible=False)
|
17 |
detected_language = gr.Textbox(label="Detected Language", visible=False)
|
18 |
|
19 |
-
#
|
20 |
-
|
21 |
-
|
22 |
-
personalities_output = gr.Textbox(visible=False)
|
23 |
-
|
24 |
-
# Container for dynamically created charts
|
25 |
-
chart_container = gr.Column()
|
26 |
-
|
27 |
def process_and_update(input_file):
|
28 |
# Process the input
|
29 |
results = process_input(input_file, progress=gr.Progress())
|
30 |
|
31 |
-
# Create and update charts
|
32 |
-
|
33 |
-
|
34 |
-
# Create new chart components based on the number of charts
|
35 |
-
new_charts = [gr.Plot(visible=True) for _ in range(len(chart_outputs) - 3)] # -3 for the non-chart outputs
|
36 |
|
37 |
-
# Update the
|
38 |
-
return
|
39 |
|
40 |
input_file.upload(
|
41 |
fn=process_and_update,
|
42 |
inputs=[input_file],
|
43 |
-
outputs=[status_text, execution_time, detected_language,
|
44 |
)
|
45 |
|
46 |
return iface
|
|
|
16 |
execution_time = gr.Textbox(label="Execution Time", visible=False)
|
17 |
detected_language = gr.Textbox(label="Detected Language", visible=False)
|
18 |
|
19 |
+
# Container for dynamically created charts and explanations
|
20 |
+
output_container = gr.Column()
|
21 |
+
|
|
|
|
|
|
|
|
|
|
|
22 |
def process_and_update(input_file):
|
23 |
# Process the input
|
24 |
results = process_input(input_file, progress=gr.Progress())
|
25 |
|
26 |
+
# Create and update charts and explanations
|
27 |
+
outputs = update_visibility_and_charts(*results)
|
|
|
|
|
|
|
28 |
|
29 |
+
# Update the output container
|
30 |
+
return outputs
|
31 |
|
32 |
input_file.upload(
|
33 |
fn=process_and_update,
|
34 |
inputs=[input_file],
|
35 |
+
outputs=[status_text, execution_time, detected_language, output_container]
|
36 |
)
|
37 |
|
38 |
return iface
|