chaojiemao commited on
Commit
217464b
·
verified ·
1 Parent(s): 5056693

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -17,6 +17,7 @@ KEEP_RUNING_TASK = 3600 * 1
17
  # the total running task number in 1800 seconds
18
  LIMIT_RUNING_TASK = 2
19
  LIMIT_HISTORY_RUNING_TASK = 4
 
20
 
21
  task_status = {}
22
 
@@ -287,12 +288,13 @@ with gr.Blocks() as demo:
287
  watermark_wan = gr.Checkbox(label="Watermark", value=True, visible=True, container=False)
288
  seed = gr.Number(label="Seed", value=-1, container=True)
289
  cost_time = gr.Number(label="Cost Time(secs)", value=online_get_cost_time, interactive=False,
290
- every=120, inputs=[task, t2v_task_id, i2v_task_id], container=True)
291
  waiting_time = gr.Number(label="Estimated Waiting Time(secs)", value=online_get_waiting_time, interactive=False,
292
- every=120, inputs=[task, t2v_task_id, i2v_task_id], container=True)
293
  process_bar = gr.Slider(show_label=True, label="", value=get_process_bar, maximum=100,
294
- interactive=True, every=120, inputs=[task, t2v_task_id, i2v_task_id, status], container=True)
295
-
 
296
  fake_video = gr.Video(label='Examples', visible=False, interactive=False)
297
  with gr.Row(visible=True) as t2v_eg:
298
  gr.Examples(t2v_examples,
@@ -382,4 +384,4 @@ with gr.Blocks() as demo:
382
  )
383
 
384
  demo.queue(max_size=10)
385
- demo.launch(ssr_mode=False)
 
17
  # the total running task number in 1800 seconds
18
  LIMIT_RUNING_TASK = 2
19
  LIMIT_HISTORY_RUNING_TASK = 4
20
+ FRESH_TIME = 3600
21
 
22
  task_status = {}
23
 
 
288
  watermark_wan = gr.Checkbox(label="Watermark", value=True, visible=True, container=False)
289
  seed = gr.Number(label="Seed", value=-1, container=True)
290
  cost_time = gr.Number(label="Cost Time(secs)", value=online_get_cost_time, interactive=False,
291
+ every=FRESH_TIME, inputs=[task, t2v_task_id, i2v_task_id], container=True)
292
  waiting_time = gr.Number(label="Estimated Waiting Time(secs)", value=online_get_waiting_time, interactive=False,
293
+ every=FRESH_TIME, inputs=[task, t2v_task_id, i2v_task_id], container=True)
294
  process_bar = gr.Slider(show_label=True, label="", value=get_process_bar, maximum=100,
295
+ interactive=True, every=FRESH_TIME, inputs=[task, t2v_task_id, i2v_task_id, status], container=True)
296
+ with gr.Row():
297
+ gr.Markdown('<span style="color: blue;">Due to automatic refresh of task status causing significant network congestion, please manually click the "Refresh Generating Status" button to check the task status.</span>')
298
  fake_video = gr.Video(label='Examples', visible=False, interactive=False)
299
  with gr.Row(visible=True) as t2v_eg:
300
  gr.Examples(t2v_examples,
 
384
  )
385
 
386
  demo.queue(max_size=10)
387
+ demo.launch()