Update app.py
Browse files
app.py
CHANGED
@@ -68,9 +68,9 @@ class CNN1DLSTMAudioClassifier(nn.Module):
|
|
68 |
|
69 |
num_class = 6
|
70 |
model = CNN1DLSTMAudioClassifier(num_class)
|
71 |
-
|
72 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
73 |
-
model.load_state_dict(torch.load("speech-emotion-recognition-best-model.bin", weights_only=False))
|
|
|
74 |
model.eval()
|
75 |
|
76 |
def preprocess_single_audio(file_path, sample_rate=16000, n_mels=128, n_fft=2048, hop_length=512):
|
|
|
68 |
|
69 |
num_class = 6
|
70 |
model = CNN1DLSTMAudioClassifier(num_class)
|
|
|
71 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
72 |
+
model = model.load_state_dict(torch.load("speech-emotion-recognition-best-model.bin", weights_only=False))
|
73 |
+
model = model.to(device)
|
74 |
model.eval()
|
75 |
|
76 |
def preprocess_single_audio(file_path, sample_rate=16000, n_mels=128, n_fft=2048, hop_length=512):
|