mirari commited on
Commit
a1e6eab
1 Parent(s): 63f3e1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,12 +1,16 @@
1
  import gradio as gr
2
  import whisper
3
  from pytube import YouTube
 
4
 
5
  loaded_model = whisper.load_model("medium")
6
  current_size = 'medium'
7
  def inference(link):
8
  yt = YouTube(link)
9
- path = yt.streams.get_audio_only().download(mp3=True)
 
 
 
10
  options = whisper.DecodingOptions(language= 'Spanish', without_timestamps=True)
11
  results = loaded_model.transcribe(path)
12
  return results['text']
 
1
  import gradio as gr
2
  import whisper
3
  from pytube import YouTube
4
+ from whisper import dowload_youtube_video, transcribe_audio
5
 
6
  loaded_model = whisper.load_model("medium")
7
  current_size = 'medium'
8
  def inference(link):
9
  yt = YouTube(link)
10
+ #path = yt.streams.get_audio_only().download(mp3=True)
11
+
12
+ path = dowload_youtube_video(link)
13
+
14
  options = whisper.DecodingOptions(language= 'Spanish', without_timestamps=True)
15
  results = loaded_model.transcribe(path)
16
  return results['text']