reab5555 commited on
Commit
78f6fde
·
verified ·
1 Parent(s): 6f3640e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -16
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
- # Hidden textboxes for storing model outputs
20
- attachments_output = gr.Textbox(visible=False)
21
- bigfive_output = gr.Textbox(visible=False)
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
- chart_outputs = update_visibility_and_charts(*results)
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 chart container
38
- return chart_outputs[:3] + [gr.Column(new_charts)]
39
 
40
  input_file.upload(
41
  fn=process_and_update,
42
  inputs=[input_file],
43
- outputs=[status_text, execution_time, detected_language, chart_container]
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