承弱 commited on
Commit
4b97602
1 Parent(s): f6c784d

add timeout fix

Browse files
Files changed (1) hide show
  1. src/generation.py +5 -2
src/generation.py CHANGED
@@ -38,8 +38,11 @@ def call_generation(prompt, mask_image_url,lora_path_ratio="0 1.0", image_width=
38
  all_res_ = []
39
  REPEAT = 1
40
  for _ in range(REPEAT):
41
- res_ = requests.post(url_create_task, data=json.dumps(data), headers=headers)
42
- all_res_.append(res_)
 
 
 
43
 
44
  all_image_data = []
45
  for res_ in all_res_:
 
38
  all_res_ = []
39
  REPEAT = 1
40
  for _ in range(REPEAT):
41
+ try:
42
+ res_ = requests.post(url_create_task, data=json.dumps(data), headers=headers, timeout=60)
43
+ all_res_.append(res_)
44
+ except:
45
+ pass
46
 
47
  all_image_data = []
48
  for res_ in all_res_: