Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,6 @@ def classify_emotion(audio_file):
|
|
26 |
# Load and process audio
|
27 |
speech, sr = librosa.load(audio_file, sr=16000)
|
28 |
inputs = processor(speech, sampling_rate=16000, return_tensors="pt", padding=True, truncation=True)
|
29 |
-
inputs["input_values"] = inputs["input_values"].unsqueeze(0) # Add batch dimension
|
30 |
|
31 |
# Get predictions
|
32 |
with torch.no_grad():
|
|
|
26 |
# Load and process audio
|
27 |
speech, sr = librosa.load(audio_file, sr=16000)
|
28 |
inputs = processor(speech, sampling_rate=16000, return_tensors="pt", padding=True, truncation=True)
|
|
|
29 |
|
30 |
# Get predictions
|
31 |
with torch.no_grad():
|