Zled commited on
Commit
d928e7a
1 Parent(s): 836d09e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ def get_emotion(microphone, file_upload, task):
17
  elif (microphone is None) and (file_upload is None):
18
  return "ERROR: You have to either use the microphone or upload an audio file"
19
 
20
- model = torch.load('model.pth')
21
  file = microphone if microphone is not None else file_upload
22
  speech, _ = librosa.load(file, sr=16000, mono=True)
23
  test = feature_extractor(speech, sampling_rate=16000, padding=True, return_tensors="pt" )
 
17
  elif (microphone is None) and (file_upload is None):
18
  return "ERROR: You have to either use the microphone or upload an audio file"
19
 
20
+ model = torch.load('model.pth').cpu()
21
  file = microphone if microphone is not None else file_upload
22
  speech, _ = librosa.load(file, sr=16000, mono=True)
23
  test = feature_extractor(speech, sampling_rate=16000, padding=True, return_tensors="pt" )