kjysmu commited on
Commit
c9e97ce
·
verified ·
1 Parent(s): 39cf3ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -271,7 +271,7 @@ class Music2emo:
271
  model = BTC_model(config=config.model).to(self.device)
272
 
273
  if os.path.isfile(model_file):
274
- checkpoint = torch.load(model_file)
275
  mean = checkpoint['mean']
276
  std = checkpoint['std']
277
  model.load_state_dict(checkpoint['model'])
 
271
  model = BTC_model(config=config.model).to(self.device)
272
 
273
  if os.path.isfile(model_file):
274
+ checkpoint = torch.load(model_file, map_location=self.device)
275
  mean = checkpoint['mean']
276
  std = checkpoint['std']
277
  model.load_state_dict(checkpoint['model'])