Mark0047's picture
Update app.py
5231c28 verified
raw
history blame
666 Bytes
# import gradio as gr
# gr.load("models/openai/whisper-large-v3-turbo").launch()
import gradio as gr
from transformers import pipeline
model = gr.load("models/openai/whisper-large-v3-turbo")
pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3-turbo")
# Define a function to process the output and extract only the transcription text
def process_transcription(audio_input):
result = pipe(audio_input)
# Extract the transcription text directly
transcription = result["text"]
return transcription
# Launch the interface
gr.Interface(
process_transcription,
gr.Audio(type="filepath"),
outputs="text"
).launch()