Spaces:
Configuration error
Configuration error
Upload 3 files
Browse files- README.md +2 -13
- app.py +22 -0
- requirements.txt +4 -0
README.md
CHANGED
@@ -1,14 +1,3 @@
|
|
1 |
-
|
2 |
-
title: Transcripcion Audio
|
3 |
-
emoji: 馃殌
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: red
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 5.34.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
short_description: tarea 4.1
|
12 |
-
---
|
13 |
|
14 |
-
|
|
|
1 |
+
# Transcripci贸n de Audio con Whisper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
Este Space permite subir un archivo de audio (voz) y obtener su transcripci贸n en texto, usando el modelo `openai/whisper-small`.
|
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import torch
|
3 |
+
import torchaudio
|
4 |
+
from transformers import pipeline
|
5 |
+
|
6 |
+
# Cargar modelo de transcripci贸n (Whisper)
|
7 |
+
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-small")
|
8 |
+
|
9 |
+
def transcribir(audio):
|
10 |
+
text = pipe(audio)["text"]
|
11 |
+
return text
|
12 |
+
|
13 |
+
# Crear interfaz con Gradio
|
14 |
+
demo = gr.Interface(
|
15 |
+
fn=transcribir,
|
16 |
+
inputs=gr.Audio(type="filepath", label="Sube tu audio"),
|
17 |
+
outputs="text",
|
18 |
+
title="Transcripci贸n de Voz",
|
19 |
+
description="Este Space usa Whisper (openai/whisper-small) para convertir audio en texto.",
|
20 |
+
)
|
21 |
+
|
22 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|
3 |
+
torchaudio
|
4 |
+
gradio
|