BeneKroetz
commited on
Commit
•
fd1e84b
1
Parent(s):
2fd6d2b
Update app.py
Browse files
app.py
CHANGED
@@ -5,15 +5,15 @@ import gradio as gr
|
|
5 |
model = whisper.load_model("base")
|
6 |
|
7 |
# Define the transcription function
|
8 |
-
def transcribe(
|
9 |
# Transcribe the audio file using Whisper
|
10 |
-
result = model.transcribe(
|
11 |
return result["text"]
|
12 |
|
13 |
# Gradio Interface for uploading audio and returning the transcription
|
14 |
iface = gr.Interface(
|
15 |
fn=transcribe,
|
16 |
-
inputs=gr.Audio(type="
|
17 |
outputs="text",
|
18 |
title="Whisper Transcription",
|
19 |
description="Upload an audio or video file to transcribe."
|
|
|
5 |
model = whisper.load_model("base")
|
6 |
|
7 |
# Define the transcription function
|
8 |
+
def transcribe(audio_file):
|
9 |
# Transcribe the audio file using Whisper
|
10 |
+
result = model.transcribe(audio_file)
|
11 |
return result["text"]
|
12 |
|
13 |
# Gradio Interface for uploading audio and returning the transcription
|
14 |
iface = gr.Interface(
|
15 |
fn=transcribe,
|
16 |
+
inputs=gr.Audio(type="filepath"), # Use 'filepath' to get the path to the uploaded file
|
17 |
outputs="text",
|
18 |
title="Whisper Transcription",
|
19 |
description="Upload an audio or video file to transcribe."
|