Spaces:
Running
Running
Commit
·
e27c16b
1
Parent(s):
9570431
Update app.py
Browse files
app.py
CHANGED
@@ -126,13 +126,7 @@ def inference_dataset2(input_file, input_checks):
|
|
126 |
plt.xticks(x_pos, bars)
|
127 |
return gr.update(value=plt, visible=True)
|
128 |
else:
|
129 |
-
|
130 |
-
bars = list(preds_dict.keys())
|
131 |
-
height = list(preds_dict.values())
|
132 |
-
x_pos = np.arange(len(bars))
|
133 |
-
plt.bar(x_pos, height, color=['lightgrey', 'firebrick', 'rebeccapurple', 'orange', 'palevioletred', 'cornflowerblue'])
|
134 |
-
plt.xticks(x_pos, bars)
|
135 |
-
return gr.update(value=plt)
|
136 |
|
137 |
|
138 |
def inference_dataset3(input_file, input_checks):
|
@@ -182,16 +176,16 @@ with gr.Blocks() as demo:
|
|
182 |
label = "Select options")
|
183 |
send_btn = gr.Button("Send")
|
184 |
with gr.Column():
|
185 |
-
output_file = gr.File(label="Predictions", visible=
|
186 |
-
next_button1 = gr.Button("Show next output", visible=
|
187 |
-
output_plot = gr.Plot(label="Emotion frequencies", visible=
|
188 |
-
next_button2 = gr.Button("Show next output", visible=
|
189 |
-
output_dist = gr.Textbox(label="Emotion distribution over time", visible=
|
190 |
-
next_button3 = gr.Button("Show next output", visible=
|
191 |
-
output_peaks = gr.Textbox(label="Peaks", visible=
|
192 |
-
next_button4 = gr.Button("Show next output", visible=
|
193 |
-
output_topics = gr.Textbox(label="Topics", visible=
|
194 |
-
send_btn.click(fn=inference_dataset1, inputs=[input_file,input_checks], outputs=[output_file,next_button1])
|
195 |
#output_file.change(fn=inference_dataset2, inputs=[input_file,input_checks], outputs=output_plot).then(fn=inference_dataset3, inputs=[input_file,input_checks], outputs=output_dist)
|
196 |
#output_plot.change(fn=inference_dataset3, inputs=[input_file,input_checks], outputs=output_dist)
|
197 |
#output_dist.change(fn=inference_dataset4, inputs=[input_file,input_checks], outputs=output_peaks)
|
|
|
126 |
plt.xticks(x_pos, bars)
|
127 |
return gr.update(value=plt, visible=True)
|
128 |
else:
|
129 |
+
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
|
132 |
def inference_dataset3(input_file, input_checks):
|
|
|
176 |
label = "Select options")
|
177 |
send_btn = gr.Button("Send")
|
178 |
with gr.Column():
|
179 |
+
output_file = gr.File(label="Predictions", visible=True)
|
180 |
+
next_button1 = gr.Button("Show next output", visible=True)
|
181 |
+
output_plot = gr.Plot(label="Emotion frequencies", visible=True)
|
182 |
+
next_button2 = gr.Button("Show next output", visible=True)
|
183 |
+
output_dist = gr.Textbox(label="Emotion distribution over time", visible=True)
|
184 |
+
next_button3 = gr.Button("Show next output", visible=True)
|
185 |
+
output_peaks = gr.Textbox(label="Peaks", visible=True)
|
186 |
+
next_button4 = gr.Button("Show next output", visible=True)
|
187 |
+
output_topics = gr.Textbox(label="Topics", visible=True)
|
188 |
+
#send_btn.click(fn=inference_dataset1, inputs=[input_file,input_checks], outputs=[output_file,next_button1])
|
189 |
#output_file.change(fn=inference_dataset2, inputs=[input_file,input_checks], outputs=output_plot).then(fn=inference_dataset3, inputs=[input_file,input_checks], outputs=output_dist)
|
190 |
#output_plot.change(fn=inference_dataset3, inputs=[input_file,input_checks], outputs=output_dist)
|
191 |
#output_dist.change(fn=inference_dataset4, inputs=[input_file,input_checks], outputs=output_peaks)
|