Spaces:
Sleeping
Sleeping
Arnab Das
commited on
Commit
·
b65af55
1
Parent(s):
2afb6fa
bug fix
Browse files
manipulate_model/utils.py
CHANGED
@@ -20,10 +20,9 @@ def get_config_and_model(model_root="manipulate_model/demo-model/audio"):
|
|
20 |
|
21 |
model = Model(config=config)
|
22 |
model_file = hf_hub_download("arnabdas8901/manipulation_detection_transformer", filename= "weights.pt")
|
23 |
-
|
|
|
24 |
print("### Model loaded from :", model_file)
|
25 |
-
#weights = torch.load(os.path.join(model_root, "weights.pt"))
|
26 |
-
#model.load_state_dict(weights["model_state_dict"])
|
27 |
|
28 |
return config, model
|
29 |
|
|
|
20 |
|
21 |
model = Model(config=config)
|
22 |
model_file = hf_hub_download("arnabdas8901/manipulation_detection_transformer", filename= "weights.pt")
|
23 |
+
weights = torch.load(model_file, map_location=torch.device("cpu"))
|
24 |
+
model.load_state_dict(weights["model_state_dict"])
|
25 |
print("### Model loaded from :", model_file)
|
|
|
|
|
26 |
|
27 |
return config, model
|
28 |
|