Profakerr commited on
Commit
ff31910
·
verified ·
1 Parent(s): 78c5e92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import torch
2
  from PIL import Image
3
  from RealESRGAN import RealESRGAN
4
  import gradio as gr
 
5
 
6
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
7
  model2 = RealESRGAN(device, scale=2)
@@ -12,6 +13,7 @@ model8 = RealESRGAN(device, scale=8)
12
  model8.load_weights('weights/RealESRGAN_x8.pth', download=True)
13
 
14
 
 
15
  def inference(image, size):
16
  global model2
17
  global model4
 
2
  from PIL import Image
3
  from RealESRGAN import RealESRGAN
4
  import gradio as gr
5
+ import spaces
6
 
7
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
8
  model2 = RealESRGAN(device, scale=2)
 
13
  model8.load_weights('weights/RealESRGAN_x8.pth', download=True)
14
 
15
 
16
+ @spaces.GPU
17
  def inference(image, size):
18
  global model2
19
  global model4