Spaces:
Running
Running
fixing map location for torch load setting deafult to cpu
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ class SourceSeparationApp:
|
|
40 |
|
41 |
def load_model(self, model_path):
|
42 |
model = separator.from_hparams(source="speechbrain/sepformer-wsj03mix", savedir='pretrained_models/sepformer-wsj03mix', run_opts={"device": device})
|
43 |
-
checkpoint = torch.load(model_path, map_location=
|
44 |
fine_tuned_model = SepformerFineTune(model)
|
45 |
fine_tuned_model.load_state_dict(checkpoint["model"])
|
46 |
return fine_tuned_model
|
|
|
40 |
|
41 |
def load_model(self, model_path):
|
42 |
model = separator.from_hparams(source="speechbrain/sepformer-wsj03mix", savedir='pretrained_models/sepformer-wsj03mix', run_opts={"device": device})
|
43 |
+
checkpoint = torch.load(model_path, map_location=torch.device("cpu")
|
44 |
fine_tuned_model = SepformerFineTune(model)
|
45 |
fine_tuned_model.load_state_dict(checkpoint["model"])
|
46 |
return fine_tuned_model
|