baudm commited on
Commit
0692e2d
1 Parent(s): d76e13c

Use PyTorch inference mode

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -38,10 +38,10 @@ class App:
38
  if name in self._model_cache:
39
  return self._model_cache[name]
40
  model = torch.hub.load('baudm/parseq', name, pretrained=True).eval()
41
- model.freeze()
42
  self._model_cache[name] = model
43
  return model
44
 
 
45
  def __call__(self, model_name, image):
46
  if image is None:
47
  return '', []
 
38
  if name in self._model_cache:
39
  return self._model_cache[name]
40
  model = torch.hub.load('baudm/parseq', name, pretrained=True).eval()
 
41
  self._model_cache[name] = model
42
  return model
43
 
44
+ @torch.inference_mode()
45
  def __call__(self, model_name, image):
46
  if image is None:
47
  return '', []