nickmuchi commited on
Commit
8d2e349
1 Parent(s): a24ab40

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +2 -2
functions.py CHANGED
@@ -236,7 +236,7 @@ def inference(link, upload, _asr_model):
236
  audio_file = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
237
 
238
  #Get size of audio file
239
- audio_size = round(os.path.getsize(path)/(1024*1024),1)
240
 
241
  #Check if file is > 24mb, if not then use Whisper API
242
  if audio_size <= 25:
@@ -249,7 +249,7 @@ def inference(link, upload, _asr_model):
249
 
250
  st.write('File size larger than 24mb, applying chunking and transcription')
251
 
252
- song = AudioSegment.from_file("audio.mp4", format='mp4')
253
 
254
  # PyDub handles time in milliseconds
255
  twenty_minutes = 20 * 60 * 1000
 
236
  audio_file = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
237
 
238
  #Get size of audio file
239
+ audio_size = round(os.path.getsize(audio_file)/(1024*1024),1)
240
 
241
  #Check if file is > 24mb, if not then use Whisper API
242
  if audio_size <= 25:
 
249
 
250
  st.write('File size larger than 24mb, applying chunking and transcription')
251
 
252
+ song = AudioSegment.from_file(audio_file, format='mp4')
253
 
254
  # PyDub handles time in milliseconds
255
  twenty_minutes = 20 * 60 * 1000