Spaces:
Sleeping
Sleeping
bug fix
Browse files
cap.py
CHANGED
|
@@ -18,7 +18,7 @@ class Predictor:
|
|
| 18 |
self.model = ResnetEncoderDecoder(char_dict).to(device)
|
| 19 |
self.model.eval()
|
| 20 |
if str(device)=='cpu':
|
| 21 |
-
check_point = self.load_safetensor(model_path, map_location=
|
| 22 |
else:
|
| 23 |
check_point = self.load_safetensor(model_path)
|
| 24 |
self.model.load_state_dict(check_point)
|
|
|
|
| 18 |
self.model = ResnetEncoderDecoder(char_dict).to(device)
|
| 19 |
self.model.eval()
|
| 20 |
if str(device)=='cpu':
|
| 21 |
+
check_point = self.load_safetensor(model_path, map_location='cpu')
|
| 22 |
else:
|
| 23 |
check_point = self.load_safetensor(model_path)
|
| 24 |
self.model.load_state_dict(check_point)
|