gokaygokay commited on
Commit
4981ff1
1 Parent(s): 7467e65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -126,15 +126,13 @@ class LazyRealESRGAN:
126
  if self.model is None:
127
  self.model = RealESRGAN(self.device, scale=self.scale)
128
  self.model.load_weights(f'models/upscalers/RealESRGAN_x{self.scale}.pth', download=False)
129
-
130
  def predict(self, img):
131
  self.load_model()
132
  return self.model.predict(img)
133
 
134
  lazy_realesrgan_x2 = LazyRealESRGAN(device, scale=2)
135
- lazy_realesrgan_x2 = torch.compile(lazy_realesrgan_x2)
136
  lazy_realesrgan_x4 = LazyRealESRGAN(device, scale=4)
137
- lazy_realesrgan_x4 = torch.compile(lazy_realesrgan_x4)
138
 
139
  @timer_func
140
  def resize_and_upscale(input_image, resolution):
 
126
  if self.model is None:
127
  self.model = RealESRGAN(self.device, scale=self.scale)
128
  self.model.load_weights(f'models/upscalers/RealESRGAN_x{self.scale}.pth', download=False)
129
+ self.model = torch.compile(self.model)
130
  def predict(self, img):
131
  self.load_model()
132
  return self.model.predict(img)
133
 
134
  lazy_realesrgan_x2 = LazyRealESRGAN(device, scale=2)
 
135
  lazy_realesrgan_x4 = LazyRealESRGAN(device, scale=4)
 
136
 
137
  @timer_func
138
  def resize_and_upscale(input_image, resolution):