sczhou commited on
Commit
c8dbf12
1 Parent(s): b5217ce
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -159,7 +159,7 @@ def inference(image, background_enhance, face_upsample, upscale, codeformer_fide
159
  restored_face = tensor2img(output, rgb2bgr=True, min_max=(-1, 1))
160
  del output
161
  torch.cuda.empty_cache()
162
- except Exception as error:
163
  print(f"\tFailed inference for CodeFormer: {error}")
164
  restored_face = tensor2img(
165
  cropped_face_t, rgb2bgr=True, min_max=(-1, 1)
@@ -257,7 +257,7 @@ demo = gr.Interface(
257
  ['04.jpg', True, True, 2, 0.1],
258
  ['05.jpg', True, True, 2, 0.1]
259
  ]
260
- ).launch()
261
 
262
- demo.queue(concurrency_count=3)
263
  demo.launch()
 
159
  restored_face = tensor2img(output, rgb2bgr=True, min_max=(-1, 1))
160
  del output
161
  torch.cuda.empty_cache()
162
+ except RuntimeError as error:
163
  print(f"\tFailed inference for CodeFormer: {error}")
164
  restored_face = tensor2img(
165
  cropped_face_t, rgb2bgr=True, min_max=(-1, 1)
 
257
  ['04.jpg', True, True, 2, 0.1],
258
  ['05.jpg', True, True, 2, 0.1]
259
  ]
260
+ )
261
 
262
+ demo.queue(concurrency_count=4)
263
  demo.launch()