import gradio as gr | |
from transformers import pipeline | |
# Załadowanie modelu Whisper | |
transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3-turbo") | |
# Funkcja do transkrypcji audio | |
def transcribe(audio): | |
result = transcriber(audio) | |
return result['text'] | |
# Tworzenie interfejsu Gradio | |
iface = gr.Interface( | |
fn=transcribe, # Funkcja przetwarzająca plik audio | |
inputs=gr.Audio(sources=["upload"], type="filepath"), # Wejście: plik audio | |
outputs="text", # Wyjście: transkrypcja tekstowa | |
title="Whisper Large V3 Turbo - Transkrypcja Audio" | |
) | |
iface.launch() | |