Men1scus commited on
Commit
432a73c
·
1 Parent(s): 5740269

fix: Raise error with message during inference failure in process_sr function

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -376,6 +376,7 @@ def process_sr(
376
  if resize_flag:
377
  image = image.resize((ori_width * rscale, ori_height * rscale))
378
  except Exception as e:
 
379
  print(f"Error during inference: {e}")
380
  image = Image.new(mode="RGB", size=(512, 512))
381
 
 
376
  if resize_flag:
377
  image = image.resize((ori_width * rscale, ori_height * rscale))
378
  except Exception as e:
379
+ raise gr.Error(f"Error during inference: {e}")
380
  print(f"Error during inference: {e}")
381
  image = Image.new(mode="RGB", size=(512, 512))
382