fanaf91318 commited on
Commit
158f7fc
·
verified ·
1 Parent(s): 4bcc5cd

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+ import torch
4
+
5
+
6
+ # Load the Whisper pipeline
7
+ pipe = pipeline("automatic-speech-recognition",
8
+ model="fanaf91318/whisper-large-v3")
9
+
10
+ def transcribe_audio(audio_file):
11
+ # Transcribe the audio
12
+ result = pipe(audio_file)
13
+
14
+ # Return the transcription
15
+ return result["text"]
16
+
17
+ # Create the Gradio interface
18
+ iface = gr.Interface(
19
+ fn=transcribe_audio,
20
+ inputs=gr.Audio(type="filepath"),
21
+ outputs="text",
22
+ title="Whisper Large v3 Audio Transcription",
23
+ description="Upload an audio file to get its transcription using Whisper Large v3."
24
+ )
25
+
26
+ # Launch the interface
27
+ iface.launch()