Spaces:
Build error
Build error
fadindashfr
commited on
Commit
·
b77752f
1
Parent(s):
17a1b09
fix RuntimeError
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ parser.read_meta(f="configs/metadata.json") # read the metadata from specified J
|
|
19 |
inference = parser.get_parsed_content("inferer")
|
20 |
network = parser.get_parsed_content("network_def")
|
21 |
preprocess = parser.get_parsed_content("preprocessing")
|
22 |
-
state_dict = torch.load("models/model.pt")
|
23 |
network.load_state_dict(state_dict, strict=True) # Loads a model’s parameter dictionary
|
24 |
network = network.to(device)
|
25 |
network.eval()
|
|
|
19 |
inference = parser.get_parsed_content("inferer")
|
20 |
network = parser.get_parsed_content("network_def")
|
21 |
preprocess = parser.get_parsed_content("preprocessing")
|
22 |
+
state_dict = torch.load("models/model.pt", map_location=torch.device('cpu'))
|
23 |
network.load_state_dict(state_dict, strict=True) # Loads a model’s parameter dictionary
|
24 |
network = network.to(device)
|
25 |
network.eval()
|