cpcris's picture
Create app.py
3ec6b68 verified
raw
history blame
1.48 kB
import gradio as gr
modelo_path = "models/proxectonos/Nos_ASR-wav2vec2-large-xlsr-53-gl-with-lm"
modelo = gr.load(modelo_path)
def cargar(audio):
outtext = modelo(audio)
print(outtext)
texto_transcrito = outtext.split("'")[1].strip()
print(texto_transcrito)
return texto_transcrito
with gr.Blocks(analytics_enabled=False) as demo:
with gr.Row():
with gr.Column():
gr.Markdown(
"""
## <img src="https://huggingface.co/spaces/proxectonos/README/resolve/main/title-card.png" width="100%" style="border-radius: 0.75rem;">
"""
)
with gr.Column():
with gr.Row():
gr.Markdown(
"""
<br/>
💻 Este space mostra o modelo ASR desenvolvido polo **[Proxecto Nós](https://huggingface.co/proxectonos)**.
<br/>
"""
)
with gr.Row():
input_audio = gr.Audio(label="Entrada", type="filepath")
with gr.Row():
output_text = gr.Textbox(label="Saida")
with gr.Row():
asr_button = gr.Button("Enviar", elem_id="send-btn", visible=True)
asr_button.click(
cargar,
inputs=[
input_audio,
],
outputs=[output_text],
)
demo.launch(debug=True)