lukehinds commited on
Commit
fcb44f9
·
1 Parent(s): ddba8fe

Resolve TypeError when processing evaluation queue data

Browse files
Files changed (1) hide show
  1. app.py +26 -24
app.py CHANGED
@@ -295,6 +295,29 @@ with demo:
295
  logger.error(f"Submission failed: {str(e)}")
296
  return gr.Markdown(f"Error: {str(e)}")
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  # Update tables periodically
299
  def update_evaluation_tables():
300
  finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
@@ -304,35 +327,14 @@ def update_evaluation_tables():
304
  pending_eval_table: gr.Dataframe.update(value=pending_eval_queue_df)
305
  }
306
 
307
- submit_button.click(
308
- handle_submission,
309
- [
310
- model_name_textbox,
311
- base_model_name_textbox,
312
- revision_name_textbox,
313
- precision,
314
- weight_type,
315
- model_type,
316
- ],
317
- submission_result,
318
- )
319
-
320
- with gr.Row():
321
- with gr.Accordion("📙 Citation", open=False):
322
- citation_button = gr.Textbox(
323
- value=CITATION_BUTTON_TEXT,
324
- label=CITATION_BUTTON_LABEL,
325
- lines=20,
326
- elem_id="citation-button",
327
- show_copy_button=True,
328
- )
329
-
330
  # Setup schedulers
331
  scheduler = BackgroundScheduler()
332
  scheduler.add_job(restart_space, "interval", seconds=1800)
333
  scheduler.add_job(process_evaluation_queue, "interval", seconds=300) # Process queue every 5 minutes
334
- scheduler.add_job(update_evaluation_tables, "interval", seconds=60) # Update tables every minute
335
  scheduler.start()
336
 
 
 
 
337
  logger.info("Application startup complete")
338
  demo.queue(default_concurrency_limit=40).launch()
 
295
  logger.error(f"Submission failed: {str(e)}")
296
  return gr.Markdown(f"Error: {str(e)}")
297
 
298
+ submit_button.click(
299
+ handle_submission,
300
+ [
301
+ model_name_textbox,
302
+ base_model_name_textbox,
303
+ revision_name_textbox,
304
+ precision,
305
+ weight_type,
306
+ model_type,
307
+ ],
308
+ submission_result,
309
+ )
310
+
311
+ with gr.Row():
312
+ with gr.Accordion("📙 Citation", open=False):
313
+ citation_button = gr.Textbox(
314
+ value=CITATION_BUTTON_TEXT,
315
+ label=CITATION_BUTTON_LABEL,
316
+ lines=20,
317
+ elem_id="citation-button",
318
+ show_copy_button=True,
319
+ )
320
+
321
  # Update tables periodically
322
  def update_evaluation_tables():
323
  finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)
 
327
  pending_eval_table: gr.Dataframe.update(value=pending_eval_queue_df)
328
  }
329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  # Setup schedulers
331
  scheduler = BackgroundScheduler()
332
  scheduler.add_job(restart_space, "interval", seconds=1800)
333
  scheduler.add_job(process_evaluation_queue, "interval", seconds=300) # Process queue every 5 minutes
 
334
  scheduler.start()
335
 
336
+ # Update evaluation tables every 60 seconds
337
+ demo.load(update_evaluation_tables, outputs=[finished_eval_table, running_eval_table, pending_eval_table], every=60)
338
+
339
  logger.info("Application startup complete")
340
  demo.queue(default_concurrency_limit=40).launch()