matheuscervantes55
commited on
Commit
•
a64afbd
1
Parent(s):
c50686f
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline(
|
5 |
+
"automatic-speech-recognition",
|
6 |
+
model="jonatasgrosman/wav2vec2-large-xlsr-53-portuguese"
|
7 |
+
)
|
8 |
+
|
9 |
+
def transcribe(audio):
|
10 |
+
text = pipe(audio)["text"]
|
11 |
+
return text
|
12 |
+
|
13 |
+
iface = gr.Interface(
|
14 |
+
fn=transcribe,
|
15 |
+
inputs=gr.Audio(sources=["upload"], type="filepath", label="Carregue o áudio"),
|
16 |
+
outputs="text",
|
17 |
+
title="Aplicativo de Reconhecimento de Fala",
|
18 |
+
description="Carregue um arquivo de áudio para transcrever sua fala.",
|
19 |
+
)
|
20 |
+
|
21 |
+
iface.launch(share=True)
|