selfitcamera commited on
Commit
d8b06ca
1 Parent(s): 015b700
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -37,7 +37,7 @@ def onClick(cloth_id, pose_image, pose_id, size, request: gr.Request):
37
  if taskId==0:
38
  return None, "fail to public you task"
39
 
40
- max_try = 10
41
  wait_s = 30
42
  for i in range(max_try):
43
  time.sleep(wait_s)
@@ -53,7 +53,7 @@ def onClick(cloth_id, pose_image, pose_id, size, request: gr.Request):
53
  pass
54
  else:
55
  return None, state
56
- return None, "task has been created, you can refresh the page latter, and check the following history tab"
57
  except Exception as e:
58
  print(e)
59
  return None, "fail to create task"
@@ -153,7 +153,7 @@ with gr.Blocks(css=css) as demo:
153
 
154
 
155
  run_button.click(fn=onClick, inputs=[cloth_id, pose_image, pose_id, size_slider],
156
- outputs=[res_image, info_text], concurrency_limit=60)
157
 
158
  pose_image.upload(fn=onUpload, inputs=[], outputs=[pose_id],)
159
  demo.load(onLoad, inputs=[], outputs=[his_pose_image1, his_res_image1,
@@ -163,7 +163,7 @@ with gr.Blocks(css=css) as demo:
163
 
164
  if __name__ == "__main__":
165
 
166
- demo.queue(max_size=60)
167
  # demo.queue(concurrency_count=60)
168
  # demo.launch(server_name='0.0.0.0', server_port=225)
169
  demo.launch(server_name='0.0.0.0')
 
37
  if taskId==0:
38
  return None, "fail to public you task"
39
 
40
+ max_try = 1
41
  wait_s = 30
42
  for i in range(max_try):
43
  time.sleep(wait_s)
 
53
  pass
54
  else:
55
  return None, state
56
+ return None, "task has been created successfully, you can refresh the page 5 mins latter, and check the following history tab"
57
  except Exception as e:
58
  print(e)
59
  return None, "fail to create task"
 
153
 
154
 
155
  run_button.click(fn=onClick, inputs=[cloth_id, pose_image, pose_id, size_slider],
156
+ outputs=[res_image, info_text], concurrency_limit=50)
157
 
158
  pose_image.upload(fn=onUpload, inputs=[], outputs=[pose_id],)
159
  demo.load(onLoad, inputs=[], outputs=[his_pose_image1, his_res_image1,
 
163
 
164
  if __name__ == "__main__":
165
 
166
+ demo.queue(max_size=50)
167
  # demo.queue(concurrency_count=60)
168
  # demo.launch(server_name='0.0.0.0', server_port=225)
169
  demo.launch(server_name='0.0.0.0')