k2-fsa / sherpa

Speech-to-text server framework with next-gen Kaldi
https://k2-fsa.github.io/sherpa
Apache License 2.0
558 stars 108 forks source link

[help wanted] run server streaming #238

Closed alidabaghi123 closed 1 year ago

alidabaghi123 commented 1 year ago

hello, everyone. I have been installing sherpa and when I wanted to run streaming server.py. encounter with this error,

![Uploading image.png…]()

csukuangfj commented 1 year ago

Could you re-upload the image? It is not readable.

alidabaghi123 commented 1 year ago

ok. thanks for concern Screenshot from 2022-12-06 12-30-47

csukuangfj commented 1 year ago

Please recheck that your have downloaded the pre-trained models correctly (using git lfs install). That is, you can use

ls -lh

to show the file size of the .pt file.

alidabaghi123 commented 1 year ago

I have checked icefall files and found pt model.

Screenshot from 2022-12-06 12-43-03

alidabaghi123 commented 1 year ago

do i downloaded from another repository???

csukuangfj commented 1 year ago

you can see that the .pt file is only 134 bytes

Please use

cd exp
git lfs pull --include "cpu-jit-epoch-30-avg-10-torch-1.6.0.pt"

(I think you have missed the command git lfs install as described in the documentation)

alidabaghi123 commented 1 year ago

thank you, i am downloading.

alidabaghi123 commented 1 year ago

hello again, I downloaded the model and encounter this error Screenshot from 2022-12-06 14-58-39

alidabaghi123 commented 1 year ago

can you help me, again

csukuangfj commented 1 year ago

Are you using the latest version of sherpa? If not, please use the latest version of sherpa.

alidabaghi123 commented 1 year ago

I installed this version\ Screenshot from 2022-12-06 15-07-32

can you help me, again

csukuangfj commented 1 year ago

I installed this version Screenshot from 2022-12-06 15-07-32

can you help me, again

We have been in 1.0 for a long time. It is not clear which commit you are using.

How did you install sherpa?

What is the output of

sherpa-version

The line numbers in your error logs don't match the latest file https://github.com/k2-fsa/sherpa/blob/master/sherpa/bin/pruned_stateless_emformer_rnnt2/streaming_server.py

alidabaghi123 commented 1 year ago

Screenshot from 2022-12-06 15-28-39

csukuangfj commented 1 year ago

How did you install sherpa?

csukuangfj commented 1 year ago

I suggest that you uninstall sherpa and reinstall it using the latest master.

alidabaghi123 commented 1 year ago

with pip

csukuangfj commented 1 year ago

Screenshot from 2022-12-06 15-28-39

The git sha1 and git date are empty. It is not possible to tell which commit you are using.


Please install the latest master of sherpa.

alidabaghi123 commented 1 year ago

i used this page for install sherpa https://k2-fsa.github.io/sherpa/python/installation/index.html

csukuangfj commented 1 year ago

Please select this one

git clone https://github.com/k2-fsa/sherpa
cd sherpa

# Install the dependencies
pip install -r ./requirements.txt

# Install the C++ extension.
# Use one of the following methods:
#
# (1)
python3 setup.py install --verbose
alidabaghi123 commented 1 year ago

thank you. i am trying installl again

csukuangfj commented 1 year ago

Remember to uninstall sherpa first

pip uninstall k2-sherpa
alidabaghi123 commented 1 year ago

I am installing. With 96 mycomputer locked 16703309835606896063639228848608

alidabaghi123 commented 1 year ago

I am waiting long time even now

csukuangfj commented 1 year ago

How large is your RAM and how many CPUs do you have?

alidabaghi123 commented 1 year ago

Screenshot from 2022-12-06 17-13-18

alidabaghi123 commented 1 year ago

i forced restart my pc

csukuangfj commented 1 year ago

Could you change https://github.com/k2-fsa/sherpa/blob/b933ac22b6f1d1871d10d52bc2ee60ea0b115f3b/cmake/cmake_extension.py#L104 to

-j1

before running python3 setup.py install?

alidabaghi123 commented 1 year ago

thank you for replying again. i am installing now

alidabaghi123 commented 1 year ago

is that true???

Screenshot from 2022-12-06 17-30-58

csukuangfj commented 1 year ago

Did you use wget or git clone to download the source code? It's strange that git sha1 and git date is empty for sherpa.

Can you re-run your streaming_server.py and see if it still causes errors?

alidabaghi123 commented 1 year ago

hello agian. i have downloded sherpa from master and succesfully installed web server. i am very thrilling in speed of decoding.
do i read how to improving speed of decoding??? can i replace my model????

alidabaghi123 commented 1 year ago

thank you very lot for helping me

alidabaghi123 commented 1 year ago

can i train this models with mexican language???

csukuangfj commented 1 year ago

do i read how to improving speed of decoding???

Do you have a problem with the speed of decoding? Does it run very slowly?


can i replace my model????

What is the type of your model? Transducer, ctc, or attention based encoder-decoder, or any other kinds of models?


can i train this models with mexican language???

Yes, as long as you have the data and some GPUs. The training code is at http://github.com/k2-fsa/icefall This repo is for speech recognition with pre-trained models from icefall.

alidabaghi123 commented 1 year ago

do i read how to improving speed of decoding???

Do you have a problem with the speed of decoding? Does it run very slowly?

can i replace my model????

What is the type of your model? Transducer, ctc, or attention based encoder-decoder, or any other kinds of models?

can i train this models with mexican language???

Yes, as long as you have the data and some GPUs. The training code is at http://github.com/k2-fsa/icefall This repo is for speech recognition with pre-trained models from icefall.

no i mean, very fast.

alidabaghi123 commented 1 year ago

I have trained conformer with nemo toolkit.

csukuangfj commented 1 year ago

I have trained conformer with nemo toolkit.

What kind of loss are you using?

CTC loss ?

alidabaghi123 commented 1 year ago

yes

csukuangfj commented 1 year ago

yes

Then it is supported by sherpa.

Are you able to export your model via torchscript, either with torch.jit.script() or torch.jit.trace()?

If so, are you able to make it public? (If so, we can add it to sherpa. Otherwise, we can tell you how to modify the code and you have to make the changes by yourself).

alidabaghi123 commented 1 year ago

I have pretraind conformer bpe model and use ctc loss. i use pyctc for decoding.

alidabaghi123 commented 1 year ago

my model havent high quality now. and i am trying improve model accuracy. then i public model

csukuangfj commented 1 year ago

If you are going to make the model public, is it possible to provide a model for testing so that I can add it to sherpa. (The model does not need to be of high recognition accuracy).

You only need to provide a torchscript model and a token list (mapping token to its integer ID).

alidabaghi123 commented 1 year ago

I have trained this model from this link https://github.com/NVIDIA/NeMo/tree/b8cc5030d4cb95a7e3ce7a8c22ef9d736c5c0bfc/nemo/collections/asr/models

alidabaghi123 commented 1 year ago

i have trained squeez former

csukuangfj commented 1 year ago

https://github.com/NVIDIA/NeMo/tree/b8cc5030d4cb95a7e3ce7a8c22ef9d736c5c0bfc/nemo/collections/asr/models

Thanks!

Are you able to provide a torchscript model?

csukuangfj commented 1 year ago

You may find https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/core/export.html useful.

alidabaghi123 commented 1 year ago

thank you. i will be trying load model in torch script.

alidabaghi123 commented 1 year ago

i may be trying to train your model with Mexican language????

csukuangfj commented 1 year ago

i may be trying to train your model with Mexican language????

Yes, that is also possible. How large is your dataset (i.e., how many hours of your training data)?


If you already have a pre-trained model, it may be easier to export it via torchscript and use it with sherpa. It may take some time to train a model.

please have a look at http://github.com/k2-fsa/icefall if you want to train your model with icefall. Feel free to create any issues if you encounter problems.

alidabaghi123 commented 1 year ago

can i help you to how preproccesing data and train it???