Update functions.py
Browse files- 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(
|
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(
|
278 |
|
279 |
else:
|
280 |
|
281 |
st.write('File size larger than 24mb, applying chunking and transcription')
|
282 |
|
283 |
-
song = AudioSegment.from_file(
|
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
|