Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,15 +45,15 @@ def classify_emotion(audio):
|
|
45 |
#### Emotion classification ####
|
46 |
emotion_classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
|
47 |
out_prob, score, index, text_lab = emotion_classifier.classify_file(audio)
|
48 |
-
|
49 |
-
return emo_dict[text_lab[0]], emostr
|
50 |
|
51 |
# Create a Gradio interface with audio file and text inputs
|
52 |
def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, explitive_selection):
|
53 |
# Transcribe the audio file using Whisper ASR
|
54 |
if audio_file != None:
|
55 |
transcribed_text = pipe(audio_file)["text"]
|
56 |
-
|
|
|
57 |
else:
|
58 |
transcribed_text = text_input
|
59 |
if classify_anxiety != "misophonia":
|
|
|
45 |
#### Emotion classification ####
|
46 |
emotion_classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
|
47 |
out_prob, score, index, text_lab = emotion_classifier.classify_file(audio)
|
48 |
+
return emo_dict[text_lab[0]]
|
|
|
49 |
|
50 |
# Create a Gradio interface with audio file and text inputs
|
51 |
def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, explitive_selection):
|
52 |
# Transcribe the audio file using Whisper ASR
|
53 |
if audio_file != None:
|
54 |
transcribed_text = pipe(audio_file)["text"]
|
55 |
+
|
56 |
+
print("emo_class ", emo_class, "explitive select", explitive_selection)
|
57 |
else:
|
58 |
transcribed_text = text_input
|
59 |
if classify_anxiety != "misophonia":
|