Spaces:
Runtime error
Runtime error
Use PyTorch inference mode
Browse files
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 '', []
|