doevent commited on
Commit
df80b79
1 Parent(s): 7f5a3aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -16,6 +16,10 @@ def inference(image, size):
16
  if image is None:
17
  raise gr.Error("Image not uploaded")
18
 
 
 
 
 
19
  if torch.cuda.is_available():
20
  torch.cuda.empty_cache()
21
 
 
16
  if image is None:
17
  raise gr.Error("Image not uploaded")
18
 
19
+ width, height = image.size
20
+ if width >= 5000 or height >= 5000:
21
+ raise gr.Error("The image is too large.")
22
+
23
  if torch.cuda.is_available():
24
  torch.cuda.empty_cache()
25