File size: 557 Bytes
1ecbd6e 4e86b8c 59d8ead 4e86b8c 0d5a69e 4e86b8c 0d5a69e a37a819 4e86b8c a37a819 0d5a69e 4e86b8c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import whisper
def convert_to_text(audio_path: str) -> str:
model = whisper.load_model("base")
result = model.transcribe(audio_path)
return result["text"]
audio_input = gr.inputs.Audio(type="file", label="Upload an Audio")
iface = gr.Interface(
fn=convert_to_text,
inputs=audio_input,
outputs="text",
title="Transform your audio into text",
description="Upload an audio here, either from your mobile or laptop and get it transcribed in a matter of seconds.",
theme="Monochrome"
)
iface.launch()
|