Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,18 @@
|
|
1 |
import whisper
|
2 |
-
|
3 |
-
from fastapi.responses import PlainTextResponse
|
4 |
-
|
5 |
-
app = FastAPI()
|
6 |
|
7 |
model = whisper.load_model("large")
|
8 |
|
9 |
-
|
10 |
-
async def transcribe(file: UploadFile):
|
11 |
-
audio = await file.read()
|
12 |
result = model.transcribe(audio, language="es")
|
13 |
-
return
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import whisper
|
2 |
+
import gradio as gr
|
|
|
|
|
|
|
3 |
|
4 |
model = whisper.load_model("large")
|
5 |
|
6 |
+
def transcribe(audio):
|
|
|
|
|
7 |
result = model.transcribe(audio, language="es")
|
8 |
+
return result['text']
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=transcribe,
|
12 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
13 |
+
outputs="text",
|
14 |
+
title="Transcriptor de Audio",
|
15 |
+
description="Sube un archivo de audio o graba con el micr贸fono para transcribirlo.",
|
16 |
+
)
|
17 |
+
|
18 |
+
iface.launch(share=True)
|