Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
|
|
2 |
from pytube import YouTube
|
3 |
import whisper
|
4 |
|
5 |
-
|
6 |
-
def whisper_transcript(model_size,audio_file):
|
7 |
if url:
|
8 |
link = YouTube(url)
|
9 |
source = link.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
@@ -24,7 +24,7 @@ def whisper_transcript(model_size,audio_file):
|
|
24 |
|
25 |
return transcript["text"]
|
26 |
|
27 |
-
define Gradio app interface
|
28 |
gradio_ui = gr.Interface(
|
29 |
fn=whisper_transcript,
|
30 |
title="Transcribe multi-lingual audio",
|
@@ -47,7 +47,7 @@ gradio_ui = gr.Interface(
|
|
47 |
],
|
48 |
value="base",
|
49 |
),
|
50 |
-
|
51 |
gr.Audio(label="Upload Audio File", source="upload", type="filepath"),
|
52 |
],
|
53 |
outputs=gr.outputs.Textbox(label="Whisper Transcript"),
|
|
|
2 |
from pytube import YouTube
|
3 |
import whisper
|
4 |
|
5 |
+
# define function for transcription
|
6 |
+
def whisper_transcript(model_size,url,audio_file):
|
7 |
if url:
|
8 |
link = YouTube(url)
|
9 |
source = link.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
|
|
24 |
|
25 |
return transcript["text"]
|
26 |
|
27 |
+
# define Gradio app interface
|
28 |
gradio_ui = gr.Interface(
|
29 |
fn=whisper_transcript,
|
30 |
title="Transcribe multi-lingual audio",
|
|
|
47 |
],
|
48 |
value="base",
|
49 |
),
|
50 |
+
gr.Textbox(label="Paste YouTube link here"),
|
51 |
gr.Audio(label="Upload Audio File", source="upload", type="filepath"),
|
52 |
],
|
53 |
outputs=gr.outputs.Textbox(label="Whisper Transcript"),
|