d22cs051 commited on
Commit
2ad7af5
1 Parent(s): a87778a

fixing map location for torch load setting deafult to cpu

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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=self.device)
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