Open helpinghandindia1 opened 1 year ago
Can you share a video? How do you test it exactly?
@nshmyrev shmyrev)
We are using Centos and Asterisk for our users. Can we edit any setting for faster response or should we consider hardware.
Set(tempvalue${digitp}=${SHELL(/usr/local/bin/python3 /opt/vosk-api/python/example/./test_ffmpeg.py /root/tempfiles/20222/${callerdatafile${digitp}}.wav | grep '"text" :' | cut -d'"' -f4)})
Set(tempvalue${digitp}=${SHELL(/usr/local/bin/python3 /opt/vosk-api/python/example/./test_ffmpeg.py /root/tempfiles/20222/${callerdatafile${digitp}}.wav | grep '"text" :' | cut -d'"' -f4)})
This is certainly a wrong way to use it, you need to use server with https://github.com/alphacep/vosk-server/blob/master/websocket/test_ffmpeg.py from the server, not the demo that loads the model every time.
@nshmyrev Thank you for your reply.
As you suggested to replace test_ffmpeg.py with updated version. But I don't see line model = Model(lang="hi") in updated file as we are using two different model for our users.
kindly see.
thanks
You have to start two servers and adjust websocket address accordingly
Thanks , I will test soon and update.
@nshmyrev
I just try to implement new source as file but some socket error, can you guide how to implement it.
python3 test_ffmpegV1.py abc77.wav
websockets.exceptions.InvalidURI: localhost://localhost:2700 isn't a valid URI: scheme isn't ws or wss
complete error details is as follows
[root@localhost example]# python3 test_ffmpegV1.py abc77.wav
Traceback (most recent call last):
File "test_ffmpegV1.py", line 31, in
You edited the source incorrectly, return back ws: as it was in original code
@nshmyrev Yes , I have little edited, but error is same in both case.
[root@localhost example]# python3 test_ffmpegV1.py abc77.wav
Traceback (most recent call last):
File "test_ffmpegV1.py", line 31, in
I was using vosk api not vosk server, Is there any issue , pls see.
@nshmyrev pls see following error and also guide me to start server with Hindi model
[root@localhost ~]# docker run -d -p 2700:2700 alphacep/kaldi-en:latest Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. ✔ docker.io/alphacep/kaldi-en:latest Trying to pull docker.io/alphacep/kaldi-en:latest... Getting image source signatures Copying blob be8c940edafd done Copying blob be8c940edafd done Copying blob be8c940edafd done Copying blob be8c940edafd done Copying blob be8c940edafd done Copying blob df5590a8898b done Copying blob b07d59199e84 done Copying blob 0e4f6ce137fd done Copying config e9683c9af0 done Writing manifest to image destination Storing signatures conmon: option parsing failed: Unknown option --full-attach Error: write child: broken pipe
@nshmyrev We are not highly trained in this, kindly guide with steps to proceed.
yum install docker yum install websocket*
[root@10 websocket]# ./test.py test.wav
Traceback (most recent call last):
File "./test.py", line 4, in
pls see following error and also guide me to start server with Hindi model
You have to use docker, not podman
ModuleNotFoundError: No module named 'websockets'
pip3 install websockets
@nshmyrev Thanks , seems now it is working. I have installed new docker. [root@10 websocket]# ./test.py test.wav { "partial" : "" } { "partial" : "" } { "partial" : ""
Now pls guide how to use Hindi model with it and some related use. At present our Hindi module path is /root/.cache/vosk/
And this is not working docker run -d -p 2700:2700 -v /opt/model:/root/.cache/vosk/vosk-model-hi-0.22/ alphacep/kaldi-en:latest
thanks
Try
docker run -p 2700:2700 -v /opt/vosk-model-en/model:/root/.cache/vosk/vosk-model-hi-0.22 alphacep/kaldi-en:latest
@nshmyrev No sir , this command is not working. docker run -p 2700:2700 -v /opt/vosk-model-en/model:/root/.cache/vosk/vosk-model-hi-0.22 alphacep/kaldi-en:latest
no result with this.
What is "not working". What do you see in the output.
There is no result when I tried wav Hindi file.
Which file did you try exactly? Does it have proper sample rate and format?
Yes it is well working with vosk-api but not showing output with vosk-server
What is the format of the file, vosk server is more strict about it
@nshmyrev Here I am sharing both output, First one is vosk api and second one is vosk server.
file /opt/vosk-api/python/example/test1.wav /opt/vosk-api/python/example/test1.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
/opt/vosk-api/python/example/test_ffmpeg.py /opt/vosk-api/python/example/test1.wav { "text" : "आपका नाम क्या है" }
docker run -d -p 2700:2700 -v /opt/vosk-model-en/model:/root/.cache/vosk/vosk-model-hi-0.22 alphacep/kaldi-en:latest
[root@10 websocket]# ./test_ffmpeg.py /opt/vosk-api/python/example/test1.wav "conf" : 1.000000, "end" : 1.380000, "start" : 0.900000, "word" : "yahoo" }], "text" : "opta nam yahoo"
@nshmyrev pls tell me how to use Hindi with vosk server.
Try
docker run -p 2700 alphacep/kaldi-hi
i've just pushed it
@nshmyrev I tried and following is output , pls see.
[root@10 ~]# docker run -p 2700 alphacep/kaldi-hi LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=13 max-active=7000 lattice-beam=6 LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:11:12:13:14:15 LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes. LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components. LOG (VoskAPI:ReadDataFiles():model.cc:249) Loading i-vector extractor from /opt/vosk-model-hi/model/ivector/final.ie LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done. LOG (VoskAPI:ReadDataFiles():model.cc:282) Loading HCLG from /opt/vosk-model-hi/model/graph/HCLG.fst LOG (VoskAPI:ReadDataFiles():model.cc:300) Loading words from /opt/vosk-model-hi/model/graph/words.txt LOG (VoskAPI:ReadDataFiles():model.cc:311) Loading winfo /opt/vosk-model-hi/model/graph/phones/word_boundary.int LOG (VoskAPI:ReadDataFiles():model.cc:318) Loading subtract G.fst model from /opt/vosk-model-hi/model/rescore/G.fst LOG (VoskAPI:ReadDataFiles():model.cc:320) Loading CARPA model from /opt/vosk-model-hi/model/rescore/G.carpa LOG (VoskAPI:ReadDataFiles():model.cc:326) Loading RNNLM model from /opt/vosk-model-hi/model/rnnlm/final.raw
[root@10 websocket]# ./test_ffmpeg.py /opt/vosk-api/python/example/test1.wav
Traceback (most recent call last):
File "./test_ffmpeg.py", line 31, in
@nshmyrev
thanks
docker run -d -p 2700:2700 alphacep/kaldi-hi
above is working, I am testing more
thanks
@nshmyrev
thanks it is now working. It seems connecting with internet not offline ? In our case we was working with complete model for good accuracy not light weight .
pls suggest for better use or improvement to use vosk server with asterisk , as we are not fully aware. thanks
It seems connecting with internet not offline ?
It does not require internet
pls suggest for better use or improvement to use vosk server with asterisk , as we are not fully aware.
You can update vocabulary as described in https://alphacephei.com/vosk/lm
@nshmyrev
Thanks for your suggestion and guidance, Vosk server Hindi is working now. We also need to implement English model also in same server, should we change port?
Helping Hand India NGO
We also need to implement English model also in same server, should we change port?
Yes, you can run on different port
@nshmyrev
Hi, Tried to run Microphone.py but following error, Our requirement would be like , user can speak digit in between 1-10 to reach directly to their goal ivr.
[root@localhost websocket]# pip3 install sounddevice Requirement already satisfied: sounddevice in /usr/local/lib/python3.7/site-packages (0.4.6) Requirement already satisfied: CFFI>=1.0 in /usr/local/lib/python3.7/site-packages (from sounddevice) (1.15.1) Requirement already satisfied: pycparser in /usr/local/lib/python3.7/site-packages (from CFFI>=1.0->sounddevice) (2.21)
./test_microphone.py -u ws://localhost:2700
or
[root@localhost websocket]# python3 test_microphone.py
Traceback (most recent call last):
File "test_microphone.py", line 9, in
I have tried following but only two modules showing in menuselect list.
./bootstrap ./configure --with-asterisk=/usr --prefix=/usr make
load = res_speech.so -- showing load = res_http_websocket.so -showing load = res_speech_vosk.so -not showing in menuselect.
ModuleNotFoundError: No module named '_ctypes'
Seems like you installed python from source, not from the repo. You need to install libffi-dev and recompile python then. You can find more details here:
load = res_speech_vosk.so -not showing in menuselect.
You can edit file manually with a text editor
@nshmyrev
docker run -d -p 2700:2700 alphacep/kaldi-hi:latest docker run -d -p 2702:2702 alphacep/kaldi-en:latest
[root@10 websocket]# docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4844f3a9c820 alphacep/kaldi-en:latest "python3 ./asr_serve…" 15 minutes ago Up 15 minutes 2700/tcp, 0.0.0.0:2702->2702/tcp, :::2702->2702/tcp sharp_elion 24f84267f32a alphacep/kaldi-hi:latest "python3 ./asr_serve…" 19 minutes ago Up 19 minutes 0.0.0.0:2700->2700/tcp, :::2700->2700/tcp distracted_galois
Can you suggest how to use test_ffmpeg.py for two different model/language on same server ?
@nshmyrev test_microphone.py seems working now /usr/local/bin/python3 test_microphone.py { "partial" : "" } { "partial" : ""
can you guide how to use microphone.py with asterisk dialplan so that users can take benefit of direct speaking.
We have separate module for asterisk, see vosk-asterisk project. See also eagi example in vosk-server project.
@nshmyrev
thanks
docker run -d -p 2700:2700 alphacep/kaldi-hi:latest docker run -d -p 2702:2702 alphacep/kaldi-en:latest
[root@10 websocket]# docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4844f3a9c820 alphacep/kaldi-en:latest "python3 ./asr_serve…" 15 minutes ago Up 15 minutes 2700/tcp, 0.0.0.0:2702->2702/tcp, :::2702->2702/tcp sharp_elion 24f84267f32a alphacep/kaldi-hi:latest "python3 ./asr_serve…" 19 minutes ago Up 19 minutes 0.0.0.0:2700->2700/tcp, :::2700->2700/tcp distracted_galois
pls guide how to use two different model/language on same server ? One model is working fine but we need two languages . pls see.
It should be 2702:2700 since local port is still 2700
we have en-hi model between which recognizes both languages
thank @nshmyrev We appreciate your support.
We have already researched same and started.
Hindi model hi is working good but for Indian English we are using en-in, but en-in is not seems good in word recognize. can you suggest some better use/edit for smooth function.
we don't find en-hi model at https://hub.docker.com/u/alphacep
Additionally we appreciate if you able to guide microphone.py with asterisk dialplan step by step, so that users can take benefit directly, as of now we are making wav first for workings.
Again tried to recompile with vosk-asterisk but not found - res_speech_vosk.so
thanks
Hi pls tell me make it more faster with vosk-model-hi-0.22 model. it is taking few seconds for result. pls see thanks I am using 16 gb ddr4 and ssd hdd with I5 processor.