cpcris commited on
Commit
3ec6b68
1 Parent(s): c5043fe

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -0
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ modelo_path = "models/proxectonos/Nos_ASR-wav2vec2-large-xlsr-53-gl-with-lm"
4
+ modelo = gr.load(modelo_path)
5
+
6
+ def cargar(audio):
7
+ outtext = modelo(audio)
8
+ print(outtext)
9
+ texto_transcrito = outtext.split("'")[1].strip()
10
+ print(texto_transcrito)
11
+ return texto_transcrito
12
+
13
+ with gr.Blocks(analytics_enabled=False) as demo:
14
+ with gr.Row():
15
+ with gr.Column():
16
+ gr.Markdown(
17
+ """
18
+ ## <img src="https://huggingface.co/spaces/proxectonos/README/resolve/main/title-card.png" width="100%" style="border-radius: 0.75rem;">
19
+ """
20
+ )
21
+ with gr.Column():
22
+ with gr.Row():
23
+ gr.Markdown(
24
+ """
25
+ <br/>
26
+
27
+ 💻 Este space mostra o modelo ASR desenvolvido polo **[Proxecto Nós](https://huggingface.co/proxectonos)**.
28
+ <br/>
29
+ """
30
+ )
31
+ with gr.Row():
32
+ input_audio = gr.Audio(label="Entrada", type="filepath")
33
+ with gr.Row():
34
+ output_text = gr.Textbox(label="Saida")
35
+ with gr.Row():
36
+ asr_button = gr.Button("Enviar", elem_id="send-btn", visible=True)
37
+
38
+
39
+ asr_button.click(
40
+ cargar,
41
+ inputs=[
42
+ input_audio,
43
+ ],
44
+ outputs=[output_text],
45
+
46
+ )
47
+
48
+ demo.launch(debug=True)