Deepsheka commited on
Commit
b7abe4e
·
1 Parent(s): 9b0355a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -4,12 +4,12 @@ import whisper
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,7 +47,7 @@ gradio_ui = gr.Interface(
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"),
 
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"),