Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
-
from pytube import YouTube
|
3 |
import whisper
|
4 |
|
5 |
# define function for transcription
|
6 |
-
def whisper_transcript(model_size,
|
7 |
-
|
8 |
-
|
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,7 +42,6 @@ gradio_ui = gr.Interface(
|
|
47 |
],
|
48 |
value="base",
|
49 |
),
|
50 |
-
gr.Textbox(label="Paste YouTube link here"),
|
51 |
gr.Audio(label="Upload Audio File", sources=["upload", "microphone"], type="filepath"),
|
52 |
],
|
53 |
outputs=gr.Textbox(label="Whisper Transcript"),
|
|
|
1 |
import gradio as gr
|
|
|
2 |
import whisper
|
3 |
|
4 |
# define function for transcription
|
5 |
+
def whisper_transcript(model_size, audio_file):
|
6 |
+
|
7 |
+
source = audio_file
|
|
|
|
|
|
|
|
|
8 |
|
9 |
if model_size.endswith(".en"):
|
10 |
language = "english"
|
|
|
42 |
],
|
43 |
value="base",
|
44 |
),
|
|
|
45 |
gr.Audio(label="Upload Audio File", sources=["upload", "microphone"], type="filepath"),
|
46 |
],
|
47 |
outputs=gr.Textbox(label="Whisper Transcript"),
|