vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Memory issue with full model

Open helpinghandindia1 opened this issue 2 years ago • 20 comments

Hello @nshmyrev @nnkalita and Team. We tried to use and after big time investing, it is working, We want to use for disability education purpose. We are in India and using Hindi Language. Issue is , it is working with https://alphacephei.com/vosk/models/vosk-model-small-it-0.22.zip But we need full conversion with . https://alphacephei.com/vosk/models/vosk-model-hi-0.22.zip

When we implement full version of Hindi, it start taking much time and consuming whole memory and stuck the system. Kindly help & resolve to use further.

helpinghandindia1 avatar Sep 01 '22 07:09 helpinghandindia1

Add 8Gb of memory and it will work!

nshmyrev avatar Sep 01 '22 07:09 nshmyrev

Thanks , it is already with 8 Gb memory

helpinghandindia1 avatar Sep 01 '22 07:09 helpinghandindia1

So you mean I need to add additional 8gb to see result or some other solution.

helpinghandindia1 avatar Sep 01 '22 07:09 helpinghandindia1

Add 8Gb of memory and it will work!

helpinghandindia1 avatar Sep 01 '22 08:09 helpinghandindia1

Hello @nshmyrev

I tried with total 12Gb ram but issue is same, It taking time and consume whole memory and stuck system. it is working ok with basic modal , issue with full modal. tried to use echo 1 > /proc/sys/vm/drop_caches for memory recover but not good result. pls see.

helpinghandindia1 avatar Sep 01 '22 08:09 helpinghandindia1

@nshmyrev Basic modal also consuming memory, pls see

Tasks: 216 total,   4 running, 210 sleeping,   0 stopped,   2 zombie
%Cpu(s): 23.0 us, 25.7 sy,  0.0 ni, 49.5 id,  0.5 wa,  0.8 hi,  0.6 si,  0.0 st
MiB Mem :   7653.6 total,    119.9 free,   7260.9 used,    272.8 buff/cache
MiB Swap:   1907.0 total,   1748.5 free,    158.5 used.    120.9 avail Mem

helpinghandindia1 avatar Sep 01 '22 08:09 helpinghandindia1

@nshmyrev Basic modal also consuming memory, pls see

Tasks: 216 total, 4 running, 210 sleeping, 0 stopped, 2 zombie
%Cpu(s): 23.0 us, 25.7 sy, 0.0 ni, 49.5 id, 0.5 wa, 0.8 hi, 0.6 si, 0.0 st
MiB Mem : 7653.6 total, 119.9 free, 7260.9 used, 272.8 buff/cache
MiB Swap: 1907.0 total, 1748.5 free, 158.5 used. 120.9 avail Mem

helpinghandindia1 avatar Sep 01 '22 08:09 helpinghandindia1

You'd better look on usage per-process in top command output

nshmyrev avatar Sep 01 '22 08:09 nshmyrev

@nshmyrev Yes I am monitoring same, It usually fine working with one python3 process but if two or more user start accessing, it start creating above issues. /usr/local/bin/python3 /opt/vosk-api/python/example/./test_ffmpeg.py

helpinghandindia1 avatar Sep 01 '22 08:09 helpinghandindia1

@nshmyrev You can take access of my system to check through remote if you able.

helpinghandindia1 avatar Sep 01 '22 09:09 helpinghandindia1

@nshmyrev There is two process which consuming while using vosk-api python3 and gawk, it is well working like before without using vosk-api

%Cpu(s): 28.8 us, 15.5 sy,  0.0 ni, 52.9 id,  1.6 wa,  0.7 hi,  0.5 si,  0.0 st
MiB Mem :   7653.6 total,   2706.7 free,   4497.1 used,    449.8 buff/cache
MiB Swap:   1907.0 total,   1907.0 free,      0.0 used.   2893.6 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 137586 root      20   0 2699516 209832  17580 R  64.1   2.7   0:01.93 python3
  47327 root      20   0 1730800   1.6g   3744 S  43.5  21.7  12:42.21 gawk
   6614 root      20   0 1713356   1.6g   3636 S  21.6  21.5   7:40.72 gawk
   1457 root      20   0 2743488  70832  21692 S  10.3   0.9   9:33.64 asterisk

helpinghandindia1 avatar Sep 01 '22 09:09 helpinghandindia1

Hello @nshmyrev @nnkalita and Team. We are forced by situation to stop services vosk-api in our system. Pls guide us how to overcome above issue , it is continues effecting system process and memory. We need speech to text feature related to our Disabled students education. pls support with solution.

helpinghandindia1 avatar Sep 01 '22 12:09 helpinghandindia1

@nshmyrev Any suggestion or solution for our issue, we want to continue with vosk-api

helpinghandindia1 avatar Sep 02 '22 06:09 helpinghandindia1

gawk processes are not related to vosk. You'd better find what starts them and reduce their memory usage. Or increase memory even more if you want to run everything together.

nshmyrev avatar Sep 02 '22 06:09 nshmyrev

@nshmyrev thanks for reply, yes I reviewed all and find whenever I initiate vosk-api script, gawk starts together and eat memory, otherwise rest is working fine,.

helpinghandindia1 avatar Sep 02 '22 06:09 helpinghandindia1

@nshmyrev can you tell me some solution/command to free Ram & swap memory. I tried following but not good result. echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a If I able to free ram on periodic time, I can start my vosk-api program

helpinghandindia1 avatar Sep 02 '22 08:09 helpinghandindia1

You need to figure out who starts gawk. It should not be there. gawk is certainly not a part of Vosk software

nshmyrev avatar Sep 02 '22 09:09 nshmyrev

@nshmyrev gawk is invoking in case of small model , but in case of full modal huge memory+cpu consumed. So as of now I am running echo 1 > /proc/sys/vm/drop_caches after every execution and also killing gawk periodically for testing & much better than before. thanks.

helpinghandindia1 avatar Sep 09 '22 16:09 helpinghandindia1

We never start gawk, it is not related to vosk.

nshmyrev avatar Sep 09 '22 23:09 nshmyrev

@nshmyrev

Hi, We are using vosk-api and it is working. I need your suggestion for a solution. As we are converting audio to Hindi, it is working but we need output in english . we tried vosk-model-en-us-0.22.zip and vosk-model-en-in-0.5.zip, both not working fine. only hi working. I am getting output like अनिल कुमार but i need in English like Anil Kumar I already tried trans to convert but again output is not appropriate. Hope u understand my query. pls reply .

helpinghandindia1 avatar Sep 22 '22 08:09 helpinghandindia1

vosk-model-en-us-0.22.zip English models only understand & decode English audio to English text. English models ☝️ will NOT understand Hindi audio, for that you need the Hindi model and perhaps a machine-translation (hindi-text-to-english-text)

ruohoruotsi avatar Feb 13 '23 06:02 ruohoruotsi