MarcoM003 commited on
Commit
661f235
·
verified ·
1 Parent(s): 28a5234

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
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, url, 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,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"),