lanbogao commited on
Commit
4962756
1 Parent(s): aa1a594

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -72,7 +72,6 @@ def download_audio(video_url, quality: str = '128', speed: float = None):
72
  print('audio_file', audio_file)
73
  return audio_file
74
 
75
-
76
  def get_audio(url):
77
  yt = YouTube(url)
78
  return yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
@@ -83,7 +82,8 @@ def get_transcript(url, model_size, lang, format):
83
 
84
  subtitle = get_subtitle(url, lang)
85
  print(subtitle)
86
- return subtitle
 
87
 
88
  model = whisper.load_model(model_size)
89
 
 
72
  print('audio_file', audio_file)
73
  return audio_file
74
 
 
75
  def get_audio(url):
76
  yt = YouTube(url)
77
  return yt.streams.filter(only_audio=True)[0].download(filename="tmp.mp4")
 
82
 
83
  subtitle = get_subtitle(url, lang)
84
  print(subtitle)
85
+ if subtitle:
86
+ return subtitle
87
 
88
  model = whisper.load_model(model_size)
89