nickmuchi commited on
Commit
f0fb020
1 Parent(s): 136e24e

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +3 -3
functions.py CHANGED
@@ -268,19 +268,19 @@ def inference(link, upload, _asr_model):
268
  elif upload:
269
 
270
  #Get size of audio file
271
- audio_size = round(os.path.getsize(path)/(1024*1024),1)
272
 
273
  #Check if file is > 24mb, if not then use Whisper API
274
  if audio_size <= 25:
275
 
276
  #Use whisper API
277
- results = load_whisper_api(audio_file)['text']
278
 
279
  else:
280
 
281
  st.write('File size larger than 24mb, applying chunking and transcription')
282
 
283
- song = AudioSegment.from_file("audio.mp4", format='mp4')
284
 
285
  # PyDub handles time in milliseconds
286
  twenty_minutes = 20 * 60 * 1000
 
268
  elif upload:
269
 
270
  #Get size of audio file
271
+ audio_size = round(os.path.getsize(upload)/(1024*1024),1)
272
 
273
  #Check if file is > 24mb, if not then use Whisper API
274
  if audio_size <= 25:
275
 
276
  #Use whisper API
277
+ results = load_whisper_api(upload)['text']
278
 
279
  else:
280
 
281
  st.write('File size larger than 24mb, applying chunking and transcription')
282
 
283
+ song = AudioSegment.from_file(upload)
284
 
285
  # PyDub handles time in milliseconds
286
  twenty_minutes = 20 * 60 * 1000