alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.43k stars 1.04k forks source link

Some thread parameter #1395

Closed Just-ne-Just closed 1 year ago

Just-ne-Just commented 1 year ago

Hello! I want to use VOSK model on a pretty good CPU. I saw somewhere that I can pass some "thread num" parameter (maybe set some ENV variable etc) which will allow model to parallel computations in separate threads, but I can't find the exact example. Am I right or this is the only example how I can do that (https://github.com/alphacep/vosk-api/blob/master/python/test/transcribe_scp.py)?

P.s. I am quite new to this lib, so this question might be silly, sorry for that

P.p.s. The goal in general is to make inference for one audio file faster

nshmyrev commented 1 year ago

Am I right or this is the only example how I can do that (https://github.com/alphacep/vosk-api/blob/master/python/test/transcribe_scp.py)?

Yes, if you want to process many streams in parallel. Vosk can't parallelize single stream

Just-ne-Just commented 1 year ago

Thank you!