Spaces:
Runtime error
Runtime error
seikin_alexey
commited on
Commit
·
ec70b4e
1
Parent(s):
ab7d04e
app2.py
CHANGED
@@ -3,6 +3,7 @@ import gradio as gr
|
|
3 |
import os
|
4 |
import warnings
|
5 |
warnings.filterwarnings("ignore")
|
|
|
6 |
|
7 |
# Function to get the list of audio files in the 'rec/' directory
|
8 |
def get_audio_files_list(directory="rec"):
|
@@ -31,6 +32,7 @@ emotion_dict = {
|
|
31 |
|
32 |
def predict_emotion(selected_audio):
|
33 |
file_path = os.path.join("rec", selected_audio)
|
|
|
34 |
out_prob, score, index, text_lab = learner.classify_file(file_path)
|
35 |
return emotion_dict[text_lab[0]]
|
36 |
|
|
|
3 |
import os
|
4 |
import warnings
|
5 |
warnings.filterwarnings("ignore")
|
6 |
+
import IPython.display as ipd
|
7 |
|
8 |
# Function to get the list of audio files in the 'rec/' directory
|
9 |
def get_audio_files_list(directory="rec"):
|
|
|
32 |
|
33 |
def predict_emotion(selected_audio):
|
34 |
file_path = os.path.join("rec", selected_audio)
|
35 |
+
ipd.display(ipd.Audio(file_path))
|
36 |
out_prob, score, index, text_lab = learner.classify_file(file_path)
|
37 |
return emotion_dict[text_lab[0]]
|
38 |
|