Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
#
|
5 |
asr = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
6 |
|
7 |
-
#
|
8 |
-
emo_clf = pipeline("text-classification", model="
|
|
|
9 |
|
10 |
# 3. Function to process audio
|
11 |
def predict_emotion(audio_file):
|
|
|
1 |
import gradio as gr
|
2 |
+
# from transformers import pipeline
|
3 |
+
|
4 |
+
# # 1. Whisper ASR
|
5 |
+
# asr = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
6 |
+
|
7 |
+
# # 2. Emotion classifier (Vietnamese)
|
8 |
+
# emo_clf = pipeline("text-classification", model="bkai-foundation-models/vietnamese-emotion", top_k=None)
|
9 |
from transformers import pipeline
|
10 |
|
11 |
+
# ASR bαΊ±ng Whisper
|
12 |
asr = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
13 |
|
14 |
+
# Emotion classification (Vietnamese text)
|
15 |
+
emo_clf = pipeline("text-classification", model="visolex/bartpho-emotion", top_k=None)
|
16 |
+
|
17 |
|
18 |
# 3. Function to process audio
|
19 |
def predict_emotion(audio_file):
|