Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def classify_toxicity(audio_file, text_input, classify_anxiety):
|
|
58 |
#### Emotion classification ####
|
59 |
|
60 |
emotion_classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
|
61 |
-
out_prob, score, index, text_lab =
|
62 |
|
63 |
return toxicity_score, classification_output, emo_dict[text_lab[0]], transcribed_text
|
64 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|
|
|
58 |
#### Emotion classification ####
|
59 |
|
60 |
emotion_classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
|
61 |
+
out_prob, score, index, text_lab = emotion_classifier.classify_file(audio_file.name)
|
62 |
|
63 |
return toxicity_score, classification_output, emo_dict[text_lab[0]], transcribed_text
|
64 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|