tomekstor9 commited on
Commit
9fad0db
·
verified ·
1 Parent(s): 10fe697

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -1,3 +1,20 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/openai/whisper-large-v3-turbo").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ # Załadowanie modelu Whisper
5
+ transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3-turbo")
6
+
7
+ # Funkcja do transkrypcji audio
8
+ def transcribe(audio):
9
+ result = transcriber(audio)
10
+ return result['text']
11
+
12
+ # Tworzenie interfejsu Gradio
13
+ iface = gr.Interface(
14
+ fn=transcribe, # Funkcja przetwarzająca plik audio
15
+ inputs=gr.Audio(sources=["upload"], type="filepath"), # Wejście: plik audio
16
+ outputs="text", # Wyjście: transkrypcja tekstowa
17
+ title="Whisper Large V3 Turbo - Transkrypcja Audio"
18
+ )
19
+
20
+ iface.launch()