haodongli commited on
Commit
576d93d
1 Parent(s): d3b61b1

Update gradio_demo.py

Browse files
Files changed (1) hide show
  1. gradio_demo.py +3 -11
gradio_demo.py CHANGED
@@ -64,16 +64,8 @@ def main(prompt, init_prompt, negative_prompt, num_iter, CFG, seed):
64
  gp.guidance_scale = CFG
65
  gp.noise_seed = int(seed)
66
  print('==> User Prompt:', gp.text)
67
- if os.environ.get('QUEUE_1') != "True":
68
- os.environ["CUDA_VISIBLE_DEVICES"] = "0"
69
- os.environ['QUEUE_1'] = "True"
70
- lp.workspace = 'gradio_demo_1'
71
- video_path, pro_video_path = start_training(args, lp, op, pp, gcp, gp)
72
- os.environ['QUEUE_1'] = "False"
73
- else:
74
- os.environ["CUDA_VISIBLE_DEVICES"] = "1"
75
- lp.workspace = 'gradio_demo_2'
76
- video_path, pro_video_path = start_training(args, lp, op, pp, gcp, gp)
77
  return gr.Video(value=video_path, autoplay=True), gr.Video(value=pro_video_path, autoplay=True)
78
 
79
  with gr.Blocks() as demo:
@@ -91,5 +83,5 @@ with gr.Blocks() as demo:
91
  outputs=["playable_video", "playable_video"],
92
  examples=example_inputs,
93
  cache_examples=True,
94
- concurrency_limit=2)
95
  demo.launch()
 
64
  gp.guidance_scale = CFG
65
  gp.noise_seed = int(seed)
66
  print('==> User Prompt:', gp.text)
67
+ lp.workspace = 'gradio_demo'
68
+ video_path, pro_video_path = start_training(args, lp, op, pp, gcp, gp)
 
 
 
 
 
 
 
 
69
  return gr.Video(value=video_path, autoplay=True), gr.Video(value=pro_video_path, autoplay=True)
70
 
71
  with gr.Blocks() as demo:
 
83
  outputs=["playable_video", "playable_video"],
84
  examples=example_inputs,
85
  cache_examples=True,
86
+ concurrency_limit=1)
87
  demo.launch()