Spaces:
Runtime error
Runtime error
File size: 851 Bytes
0688963 04e3103 2965981 04e3103 2965981 04e3103 2965981 04e3103 2965981 04e3103 2965981 04e3103 228f3d2 | 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 | import gradio as gr
from transformers import pipeline
# Load the Whisper-large-v3 model from Hugging Face on CPU
transcriber = pipeline(
"automatic-speech-recognition",
model="openai/whisper-large-v3",
device=-1 # Ensures the model runs on the CPU
)
def transcribe_audio(file_path):
# Transcribe the audio file from the given file path
transcription = transcriber(file_path)["text"]
return transcription
# Gradio interface setup with file path input
iface = gr.Interface(
fn=transcribe_audio,
inputs=gr.Textbox(label="Enter the file path of the audio", placeholder="e.g., /path/to/audio.wav"),
outputs="text",
title="Whisper Large v3 ASR",
description="Transcribe audio files using OpenAI's Whisper Large v3 model. Provide the file path of the audio file.",
)
# Launch the app
iface.launch(share=True)
|