Spaces:
Sleeping
Sleeping
Arnab Das
commited on
Commit
·
736efbe
1
Parent(s):
ed8b10d
bug fix
Browse files
manipulate_model/utils.py
CHANGED
|
@@ -3,6 +3,7 @@ import torch
|
|
| 3 |
import torchaudio
|
| 4 |
import numpy as np
|
| 5 |
from omegaconf import OmegaConf
|
|
|
|
| 6 |
from torch.nn.functional import pad, normalize, softmax
|
| 7 |
|
| 8 |
from manipulate_model.model import Model
|
|
@@ -17,7 +18,9 @@ def get_config_and_model(model_root="manipulate_model/demo-model/audio"):
|
|
| 17 |
if isinstance(config.model.decoder, str):
|
| 18 |
config.model.decoder = OmegaConf.load(config.model.decoder)
|
| 19 |
|
| 20 |
-
model = Model
|
|
|
|
|
|
|
| 21 |
#weights = torch.load(os.path.join(model_root, "weights.pt"))
|
| 22 |
#model.load_state_dict(weights["model_state_dict"])
|
| 23 |
|
|
|
|
| 3 |
import torchaudio
|
| 4 |
import numpy as np
|
| 5 |
from omegaconf import OmegaConf
|
| 6 |
+
from huggingface_hub import hf_hub_download
|
| 7 |
from torch.nn.functional import pad, normalize, softmax
|
| 8 |
|
| 9 |
from manipulate_model.model import Model
|
|
|
|
| 18 |
if isinstance(config.model.decoder, str):
|
| 19 |
config.model.decoder = OmegaConf.load(config.model.decoder)
|
| 20 |
|
| 21 |
+
model = Model(config=config)
|
| 22 |
+
model_file = hf_hub_download("arnabdas8901/manipulation_detection_transformer")
|
| 23 |
+
print(model_file)
|
| 24 |
#weights = torch.load(os.path.join(model_root, "weights.pt"))
|
| 25 |
#model.load_state_dict(weights["model_state_dict"])
|
| 26 |
|