ZennyKenny commited on
Commit
49b9cda
·
verified ·
1 Parent(s): 9a8c785

fix syntax

Browse files
Files changed (1) hide show
  1. app.py +10 -17
app.py CHANGED
@@ -289,9 +289,11 @@ def main() -> None:
289
  # Fetch the data initially
290
  fetch_data()
291
 
 
 
292
  scheduler = BackgroundScheduler()
293
  scheduler.add_job(
294
- func=fetch_data, trigger="interval", seconds=update_interval, max_instances=1
295
  )
296
  scheduler.start()
297
 
@@ -333,7 +335,7 @@ def main() -> None:
333
  kpi_chart_submitted,
334
  inputs=[],
335
  outputs=[kpi_submitted_plot],
336
- every=update_interval_charts
337
  )
338
 
339
  kpi_remaining_plot = gr.Plot(label="Plot")
@@ -341,7 +343,7 @@ def main() -> None:
341
  kpi_chart_remaining,
342
  inputs=[],
343
  outputs=[kpi_remaining_plot],
344
- every=update_interval_charts
345
  )
346
 
347
  donut_total_plot = gr.Plot(label="Plot")
@@ -349,7 +351,7 @@ def main() -> None:
349
  donut_chart_total,
350
  inputs=[],
351
  outputs=[donut_total_plot],
352
- every=update_interval_charts
353
  )
354
 
355
  gr.Markdown(
@@ -363,10 +365,7 @@ def main() -> None:
363
 
364
  kpi_hall_plot = gr.Plot(label="Plot")
365
  demo.load(
366
- kpi_chart_total_annotators,
367
- inputs=[],
368
- outputs=[kpi_hall_plot],
369
- every=update_interval_charts
370
  )
371
 
372
  top_df_plot = gr.Dataframe(
@@ -378,19 +377,13 @@ def main() -> None:
378
  row_count=10,
379
  col_count=(2, "fixed"),
380
  interactive=False,
381
- every=update_interval
382
- )
383
-
384
- demo.load(
385
- get_top,
386
- None,
387
- [top_df_plot],
388
- every=update_interval_charts
389
  )
 
390
 
391
  # Launch the Gradio interface
392
  demo.launch(share=True)
393
 
394
 
395
  if __name__ == "__main__":
396
- main()
 
289
  # Fetch the data initially
290
  fetch_data()
291
 
292
+
293
+ # Fetch the data on a schedule
294
  scheduler = BackgroundScheduler()
295
  scheduler.add_job(
296
+ func=fetch_data, trigger="interval", seconds=update_interval, max_instances=1
297
  )
298
  scheduler.start()
299
 
 
335
  kpi_chart_submitted,
336
  inputs=[],
337
  outputs=[kpi_submitted_plot],
338
+ every=update_interval_charts,
339
  )
340
 
341
  kpi_remaining_plot = gr.Plot(label="Plot")
 
343
  kpi_chart_remaining,
344
  inputs=[],
345
  outputs=[kpi_remaining_plot],
346
+ every=update_interval_charts,
347
  )
348
 
349
  donut_total_plot = gr.Plot(label="Plot")
 
351
  donut_chart_total,
352
  inputs=[],
353
  outputs=[donut_total_plot],
354
+ every=update_interval_charts,
355
  )
356
 
357
  gr.Markdown(
 
365
 
366
  kpi_hall_plot = gr.Plot(label="Plot")
367
  demo.load(
368
+ kpi_chart_total_annotators, inputs=[], outputs=[kpi_hall_plot], every=update_interval_charts
 
 
 
369
  )
370
 
371
  top_df_plot = gr.Dataframe(
 
377
  row_count=10,
378
  col_count=(2, "fixed"),
379
  interactive=False,
380
+ every=update_interval,
 
 
 
 
 
 
 
381
  )
382
+ demo.load(get_top, None, [top_df_plot], every=update_interval_charts)
383
 
384
  # Launch the Gradio interface
385
  demo.launch(share=True)
386
 
387
 
388
  if __name__ == "__main__":
389
+ main()