inoki-giskard ZeroCommand commited on
Commit
beb62dc
1 Parent(s): 2d7b381

GSK-2529-debug-section-show-jobid-fix-layout (#32)

Browse files

- show job id and fix for layout (2c82b2845167073de614d5fd9976970f8812310d)


Co-authored-by: zcy <ZeroCommand@users.noreply.huggingface.co>

Files changed (2) hide show
  1. app.py +1 -1
  2. app_debug.py +12 -6
app.py CHANGED
@@ -14,7 +14,7 @@ try:
14
  with gr.Tab("Leaderboard"):
15
  get_demo_leaderboard()
16
  with gr.Tab("Logs(Debug)"):
17
- get_demo_debug(demo)
18
 
19
  start_process_run_job()
20
 
 
14
  with gr.Tab("Leaderboard"):
15
  get_demo_leaderboard()
16
  with gr.Tab("Logs(Debug)"):
17
+ get_demo_debug()
18
 
19
  start_process_run_job()
20
 
app_debug.py CHANGED
@@ -45,14 +45,20 @@ def get_config_files():
45
  ]
46
  return config_files
47
 
 
 
48
 
49
- def get_demo(demo):
 
 
 
 
 
 
 
50
  with gr.Row():
51
- # check if jobs is an attribute of pipe
52
- gr.Markdown(
53
- lambda: f"Current job: {pipe.current}, Jobs in queue: {len(pipe.jobs)}"
54
- if len(pipe.jobs) > 0 or pipe.current is not None
55
- else "No jobs in queue, please submit an evaluation task from another tab.",
56
  every=5,
57
  )
58
  with gr.Accordion(label="Log Files", open=False):
 
45
  ]
46
  return config_files
47
 
48
+ def get_jobs_info_in_queue():
49
+ return [f"⌛️job id {job[0]}: {job[2]}<br/>" for job in pipe.jobs]
50
 
51
+ def get_queue_status():
52
+ if len(pipe.jobs) > 0 or pipe.current is not None:
53
+ return f'<div style="padding-top: 5%">Current job: {pipe.current} <br/> Jobs in queue: <br/> {"".join(get_jobs_info_in_queue())}</div>'
54
+ else:
55
+ return '<div style="padding-top: 5%">No jobs in queue, please submit an evaluation task from another tab.</div>'
56
+
57
+
58
+ def get_demo():
59
  with gr.Row():
60
+ gr.HTML(
61
+ value=get_queue_status,
 
 
 
62
  every=5,
63
  )
64
  with gr.Accordion(label="Log Files", open=False):