lunadebruyne commited on
Commit
1a53131
·
1 Parent(s): 34e5eed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -20,12 +20,21 @@ def what_happened1(text):
20
 
21
  def what_happened2(file_object, option_list):
22
  if file_object:
23
- output = "You uploaded a file."
24
  if len(option_list) > 0:
25
- output = output + "\nYou selected these options:\n- " + "\n- ".join(option_list)
26
  else:
27
- output = "You should upload a file."
28
- return output
 
 
 
 
 
 
 
 
 
29
 
30
 
31
  iface0 = gr.Interface(
@@ -62,7 +71,7 @@ iface2 = gr.Interface(
62
  ["emotion frequencies", "emotion distribution over time", "peaks", "topics"],
63
  label = "Select options")
64
  ],
65
- outputs="text")
66
 
67
  iface = gr.TabbedInterface([iface1, iface2], ["Sentence", "Dataset"])
68
 
 
20
 
21
  def what_happened2(file_object, option_list):
22
  if file_object:
23
+ output1 = "You uploaded a file."
24
  if len(option_list) > 0:
25
+ output1 = output1 + "\nYou selected these options:\n- " + "\n- ".join(option_list)
26
  else:
27
+ output1 = "You should upload a file."
28
+ output2 = output3 = output4 = output5 = "This option was not selected."
29
+ if "emotion frequencies" in option_list:
30
+ output2 = "This option was selected."
31
+ if "emotion distribution over time" in option_list:
32
+ output3 = "This option was selected."
33
+ if "peaks" in option_list:
34
+ output4 = "This option was selected."
35
+ if "topics" in option_list:
36
+ output5 = "This option was selected."
37
+ return [output1, output2, output3, output4, output5]
38
 
39
 
40
  iface0 = gr.Interface(
 
71
  ["emotion frequencies", "emotion distribution over time", "peaks", "topics"],
72
  label = "Select options")
73
  ],
74
+ outputs=["text", "text", "text", "text", "text"])
75
 
76
  iface = gr.TabbedInterface([iface1, iface2], ["Sentence", "Dataset"])
77