wgcv commited on
Commit
34321c5
Β·
verified Β·
1 Parent(s): 999c59d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -24
app.py CHANGED
@@ -23,29 +23,27 @@ def get_shared_text():
23
  return shared_text
24
 
25
  with demo:
26
- gr.Markdown("## Transcribe audio2text and sentimental classification - Spanish")
27
- with gr.Tabs():
28
- with gr.TabItem("Transcribe"):
29
- with gr.Row():
30
- audio_input = gr.Audio(sources=["microphone"], type="filepath")
31
- texto_output = gr.Textbox(label="Audio to text", value=shared_text)
32
- texto_output.change(fn=update_text, inputs=texto_output, outputs=texto_output)
33
-
34
- with gr.Row():
35
- b1 = gr.Button("Transcribe πŸŽ™οΈβœπŸ»")
36
- with gr.TabItem("Sentimental Classification"):
37
- with gr.Row():
38
- texto_input = gr.Textbox(label="Audio to text", value=shared_text)
39
- texto_input.change(fn=update_text, inputs=texto_input, outputs=texto_input)
40
- sentimiento_output = gr.Label()
41
- with gr.Row():
42
- b2 = gr.Button("Sentimental Classification πŸ€–")
43
-
44
- # Keep the 2 text box with the same text.
45
- texto_input.change(fn=get_shared_text, inputs=None, outputs=texto_input)
46
- texto_output.change(fn=get_shared_text, inputs=None, outputs=texto_output)
47
-
48
- b1.click(audio_a_texto, inputs=audio_input, outputs=texto_output)
49
- b2.click(texto_a_sentimiento, inputs=texto_input, outputs=sentimiento_output)
50
 
51
  demo.launch()
 
23
  return shared_text
24
 
25
  with demo:
26
+ gr.Markdown("## Transcribe audio2text and sentimental classification - Spanish")
27
+ with gr.Tabs():
28
+ with gr.TabItem("Transcribe"):
29
+ with gr.Row():
30
+ audio_input = gr.Audio(sources=["microphone"], type="filepath")
31
+ texto_output = gr.Textbox(label="Audio to text", value=shared_text)
32
+ texto_output.change(fn=update_text, inputs=texto_output, outputs=texto_output)
33
+ with gr.Row():
34
+ b1 = gr.Button("Transcribe πŸŽ™οΈβœπŸ»")
35
+ with gr.TabItem("Sentimental Classification"):
36
+ with gr.Row():
37
+ texto_input = gr.Textbox(label="Text to sentimental", value=shared_text)
38
+ texto_input.change(fn=update_text, inputs=texto_input, outputs=texto_input)
39
+ sentimiento_output = gr.Label()
40
+ with gr.Row():
41
+ b2 = gr.Button("Sentimental Classification πŸ€–")
42
+
43
+ # Keep the 2 text box with the same text.
44
+ texto_input.change(fn=get_shared_text, inputs=None, outputs=texto_input)
45
+ texto_output.change(fn=get_shared_text, inputs=None, outputs=texto_output)
46
+ b1.click(audio_a_texto, inputs=audio_input, outputs=texto_output)
47
+ b2.click(texto_a_sentimiento, inputs=texto_input, outputs=sentimiento_output)
 
 
48
 
49
  demo.launch()