Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,12 @@ import whisper
|
|
4 |
|
5 |
# define function for transcription
|
6 |
def whisper_transcript(model_size,audio_file):
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
|
14 |
if model_size.endswith(".en"):
|
15 |
language = "english"
|
@@ -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"),
|
|
|
4 |
|
5 |
# define function for transcription
|
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")
|
10 |
|
11 |
+
else:
|
12 |
+
source = audio_file
|
13 |
|
14 |
if model_size.endswith(".en"):
|
15 |
language = "english"
|
|
|
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"),
|