Esml commited on
Commit
0e77125
·
1 Parent(s): 12cd852

update app and req files

Browse files
Files changed (2) hide show
  1. app.py +21 -0
  2. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from speechbrain.pretrained.interfaces import foreign_class
4
+
5
+
6
+
7
+ def main_note(filepath):
8
+ classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
9
+ # out_prob, score, index, text_lab = classifier.classify_file("speechbrain/emotion-recognition-wav2vec2-IEMOCAP/anger.wav")
10
+ out_prob, score, index, text_lab = classifier.classify_file(filepath)
11
+ return text_lab
12
+
13
+
14
+ demo = gr.Interface(
15
+ fn= main_note,
16
+ input = gr.Audio(type="filepath"),
17
+ output= "text"
18
+ )
19
+
20
+ if __name__ == "__main__":
21
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ speechbrain