Spaces:
Running
Running
File size: 1,081 Bytes
0959a74 661f235 0959a74 1ddeb08 0959a74 fd98940 1ddeb08 fd98940 0959a74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import gradio as gr
import whisper
# define function for transcription
def whisper_transcript(model_size, audio_file):
source = audio_file
loaded_model = whisper.load_model(model_size)
transcript = loaded_model.transcribe(source, language="english")
return transcript["text"]
# define Gradio app interface
gradio_ui = gr.Interface(
fn=whisper_transcript,
theme="Nymbo/Nymbo_Theme",
title="Transcribir audios en inglés a texto",
description="**Cómo usar**: Elegir uno de los 4 modelos, subir un audio o grabarlo y clicar el botón de Submit.",
article="**Nota**: Exclusivo para audios en inglés.",
inputs=[
gr.Dropdown(
label="Select Model",
choices=[
"tiny.en",
"base.en",
"small.en",
"medium.en",
],
value="base",
),
gr.Audio(label="Upload Audio File", sources=["upload", "microphone"], type="filepath"),
],
outputs=gr.Textbox(label="Whisper Transcript"),
)
gradio_ui.queue().launch() |