ja-818 commited on
Commit
4170dd9
1 Parent(s): 05706b6

Included examples into tab

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -21,6 +21,15 @@ with gr.Blocks() as demo:
21
  upload_output_2 = gr.Textbox(label="Speech emotion")
22
  upload_output_3 = gr.Textbox(label="Text emotion")
23
  btn0 = gr.Button("Analyze audio")
 
 
 
 
 
 
 
 
 
24
  # Input-output logic based on button click
25
  btn0.click(fn=infere_voice2text, inputs=upload_input, outputs=upload_output_1)
26
  btn0.click(fn=infere_speech_emotion, inputs=upload_input, outputs=upload_output_2)
@@ -39,17 +48,5 @@ with gr.Blocks() as demo:
39
  btn1.click(fn=infere_voice2text, inputs=record_input, outputs=record_output_1)
40
  btn1.click(fn=infere_speech_emotion, inputs=record_input, outputs=record_output_2)
41
  record_output_1.change(fn=infere_text_emotion, inputs=record_output_1, outputs=record_output_3)
42
-
43
- # Examples to be used as input
44
- gr.Examples(
45
- [
46
- os.path.join(os.path.dirname(__file__), "audio/a_good_dream.wav"),
47
- os.path.join(os.path.dirname(__file__), "audio/hype_in_ai.wav"),
48
- ],
49
- upload_input,
50
- label="Examples in which speech and words express different emotions:"
51
- )
52
-
53
-
54
 
55
  demo.launch()
 
21
  upload_output_2 = gr.Textbox(label="Speech emotion")
22
  upload_output_3 = gr.Textbox(label="Text emotion")
23
  btn0 = gr.Button("Analyze audio")
24
+ # Examples to be used as input
25
+ gr.Examples(
26
+ [
27
+ os.path.join(os.path.dirname(__file__), "audio/a_good_dream.wav"),
28
+ os.path.join(os.path.dirname(__file__), "audio/hype_in_ai.wav"),
29
+ ],
30
+ upload_input,
31
+ label="Examples in which speech and words express different emotions:"
32
+ )
33
  # Input-output logic based on button click
34
  btn0.click(fn=infere_voice2text, inputs=upload_input, outputs=upload_output_1)
35
  btn0.click(fn=infere_speech_emotion, inputs=upload_input, outputs=upload_output_2)
 
48
  btn1.click(fn=infere_voice2text, inputs=record_input, outputs=record_output_1)
49
  btn1.click(fn=infere_speech_emotion, inputs=record_input, outputs=record_output_2)
50
  record_output_1.change(fn=infere_text_emotion, inputs=record_output_1, outputs=record_output_3)
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  demo.launch()