csukuangfj commited on
Commit
9f92f16
·
1 Parent(s): c926790

small fixes

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -162,10 +162,7 @@ def process(
162
  logging.info(info)
163
  logging.info(f"\nrepo_id: {repo_id}\nDetected events: {events}")
164
 
165
- events = {
166
- "headers": ["Event name", "Probability"],
167
- "data": [["bird", 0.9], ["pig", 0.8]],
168
- }
169
 
170
  return events, build_html_output(info)
171
 
@@ -223,7 +220,10 @@ with demo:
223
  model_dropdown,
224
  uploaded_file,
225
  ],
226
- outputs=[gr.Dataframe(), uploaded_html_info],
 
 
 
227
  fn=process_uploaded_file,
228
  )
229
 
@@ -243,7 +243,10 @@ with demo:
243
  model_dropdown,
244
  microphone,
245
  ],
246
- outputs=[gr.Dataframe(), recorded_html_info],
 
 
 
247
  fn=process_microphone,
248
  )
249
 
@@ -264,7 +267,10 @@ with demo:
264
  model_dropdown,
265
  uploaded_file,
266
  ],
267
- outputs=[gr.Dataframe(), uploaded_html_info],
 
 
 
268
  )
269
 
270
  record_button.click(
@@ -273,7 +279,10 @@ with demo:
273
  model_dropdown,
274
  microphone,
275
  ],
276
- outputs=[gr.Dataframe(), recorded_html_info],
 
 
 
277
  )
278
 
279
  url_button.click(
@@ -282,7 +291,7 @@ with demo:
282
  model_dropdown,
283
  url_textbox,
284
  ],
285
- outputs=[gr.Dataframe(), url_html_info],
286
  )
287
 
288
  gr.Markdown(description)
 
162
  logging.info(info)
163
  logging.info(f"\nrepo_id: {repo_id}\nDetected events: {events}")
164
 
165
+ events = [["bird", 0.9], ["pig", 0.8]]
 
 
 
166
 
167
  return events, build_html_output(info)
168
 
 
220
  model_dropdown,
221
  uploaded_file,
222
  ],
223
+ outputs=[
224
+ gr.Dataframe(headers=["Event", "Probability"]),
225
+ uploaded_html_info,
226
+ ],
227
  fn=process_uploaded_file,
228
  )
229
 
 
243
  model_dropdown,
244
  microphone,
245
  ],
246
+ outputs=[
247
+ gr.Dataframe(headers=["Event", "Probability"]),
248
+ recorded_html_info,
249
+ ],
250
  fn=process_microphone,
251
  )
252
 
 
267
  model_dropdown,
268
  uploaded_file,
269
  ],
270
+ outputs=[
271
+ gr.Dataframe(headers=["Event", "Probability"]),
272
+ uploaded_html_info,
273
+ ],
274
  )
275
 
276
  record_button.click(
 
279
  model_dropdown,
280
  microphone,
281
  ],
282
+ outputs=[
283
+ gr.Dataframe(headers=["Event", "Probability"]),
284
+ recorded_html_info,
285
+ ],
286
  )
287
 
288
  url_button.click(
 
291
  model_dropdown,
292
  url_textbox,
293
  ],
294
+ outputs=[gr.Dataframe(headers=["Event", "Probability"]), url_html_info],
295
  )
296
 
297
  gr.Markdown(description)