Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce model initialization time for online speech recognition #215

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

w11wo
Copy link
Contributor

@w11wo w11wo commented Jul 14, 2023

Implemented model_type parameter for online transducer models as suggested by @csukuangfj in this issue and based largely on this PR.

Add a new argument --model-type so that it only needs to load the model once.
Otherwise, it needs to load the model twice, where the first loading is to determine the model type.

I have tested csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-06-26 via the Python API on Linux, by specifying model_type="zipformer2" during initialization.

The model loading time is reduced from ~6 seconds to ~3 seconds for the fp32 model; while for the int8 model the time is reduced from 4.4 seconds to 2.1 seconds.

@csukuangfj
Copy link
Collaborator

Thanks!

@csukuangfj csukuangfj merged commit 5a6b55c into k2-fsa:master Jul 14, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants