lunadebruyne commited on
Commit
8034ef9
·
1 Parent(s): e27c16b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -109,7 +109,7 @@ def inference_sentence(text):
109
  output = "This sentence will be processed:\n" + text
110
  return output
111
 
112
- def inference_dataset1(input_file, input_checks):
113
  output = "output.txt"
114
  f = open(output, 'w')
115
  f.write("The predictions come here.")
@@ -176,16 +176,16 @@ with gr.Blocks() as demo:
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)
 
109
  output = "This sentence will be processed:\n" + text
110
  return output
111
 
112
+ def inference_dataset1(input_file):
113
  output = "output.txt"
114
  f = open(output, 'w')
115
  f.write("The predictions come here.")
 
176
  label = "Select options")
177
  send_btn = gr.Button("Send")
178
  with gr.Column():
179
+ output_file = gr.File(label="Predictions", visible=False)
180
+ next_button1 = gr.Button("Show next output", visible=False)
181
+ output_plot = gr.Plot(label="Emotion frequencies", visible=False)
182
+ next_button2 = gr.Button("Show next output", visible=False)
183
+ output_dist = gr.Textbox(label="Emotion distribution over time", visible=False)
184
+ next_button3 = gr.Button("Show next output", visible=False)
185
+ output_peaks = gr.Textbox(label="Peaks", visible=False)
186
+ next_button4 = gr.Button("Show next output", visible=False)
187
+ output_topics = gr.Textbox(label="Topics", visible=False)
188
+ send_btn.click(fn=inference_dataset1, inputs=input_file, 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)