Open tomudo opened 1 year ago
Me too. So I try 30 sec wav instead, it works!.
For the large file, please try to split out your audio file (.wav
) to be multi-parts(or files). In each part, should have maximum range of wav file to be 30 sec.
Then loop get the result or write into your output file, ex. :
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:512'
for fname in os.listdir(audio_folder):
# Split your video into "temp_folder",
# you should clear this directory before split the new one
split_audio(audio_folder, fname, temp_folder)
# Loop get result
for wavfile in os.listdir(temp_folder):
torch.cuda.empty_cache()
result = asr(data=f'{temp_folder}/{wavfile}', model=model, sampling_rate=16_000)
print(result)
torch.cuda.empty_cache()
del os.environ['PYTORCH_CUDA_ALLOC_CONF']
I test with 1:00 min wav file but it run out of GPU memory.
How could I run with a larger file?