huggingface / distil-whisper

Distilled variant of Whisper for speech recognition. 6x faster, 50% smaller, within 1% word error rate.
MIT License
3.33k stars 238 forks source link

WER Filtering takes too long? #80

Open macabdul9 opened 4 months ago

macabdul9 commented 4 months ago

Hi @sanchit-gandhi !

Currently, WER filtering takes way too long with 8 workers, and going beyond 8 gives self.pid = os.fork() OSError: [Errno 12] Cannot allocate memory. Also, it doesn't seem to cache filtered data which makes it too hard to run it for large data (up to 1M segments). Is there a way to expedite the filtering process?

sanchit-gandhi commented 4 months ago

Hey @macabdul9 - do you have a bash file configuration you're using to reproduce this error? It would be super helpful to see what configuration you're using so as to advise more appropriately here

sanchit-gandhi commented 3 months ago

Generally speaking, you should ensure that the number of workers is less than or equal to the number of CPUs on your device (you can check this with the bash command lscpu).

macabdul9 commented 3 months ago

I have replaced hf evaluate's WER metric with Jiwer's ( which I believe is same) and it fixes the issue. So mostly likely it has something to do with multiprocessing. Thanks.