Update app.py
Browse files
app.py
CHANGED
@@ -67,9 +67,10 @@ class CNN1DLSTMAudioClassifier(nn.Module):
|
|
67 |
return x
|
68 |
|
69 |
num_class = 6
|
70 |
-
model = CNN1DLSTMAudioClassifier(num_class)
|
71 |
device = torch.device('cpu')
|
72 |
-
|
|
|
|
|
73 |
model.eval()
|
74 |
|
75 |
def preprocess_single_audio(file_path, sample_rate=16000, n_mels=128, n_fft=2048, hop_length=512):
|
|
|
67 |
return x
|
68 |
|
69 |
num_class = 6
|
|
|
70 |
device = torch.device('cpu')
|
71 |
+
state_dict = torch.load('best-model-emotion-recognition.bin', map_location=device)
|
72 |
+
model = CNN1DLSTMAudioClassifier(num_class)
|
73 |
+
model.load_state_dict(state_dict)
|
74 |
model.eval()
|
75 |
|
76 |
def preprocess_single_audio(file_path, sample_rate=16000, n_mels=128, n_fft=2048, hop_length=512):
|