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

Changing hotwords without reloading model #1556

Open
mxbi opened this issue Nov 20, 2024 · 2 comments
Open

Changing hotwords without reloading model #1556

mxbi opened this issue Nov 20, 2024 · 2 comments

Comments

@mxbi
Copy link

mxbi commented Nov 20, 2024

First of all, thank you for building such a cool library.

I'm using the C++ API to load streaming Zipformer models with SherpaOnnxCreateOnlineRecognizer, using hotwords_file to bias the decoding. In my use case, there are different situations in which we're expecting different utterances, but changing the hotwords appears to require reloading the model (which is obviously)

Is there a way to change the hotwords for an already created recognizer? If not, then I could try to help implement it if you had some pointers on how to do it.

Thanks a lot!

@csukuangfj
Copy link
Collaborator

We already support it.

please see

SherpaOnnxCreateOnlineStreamWithHotwords(

@mxbi
Copy link
Author

mxbi commented Nov 26, 2024

Thank you @csukuangfj ! Could you clarify how the API should be used?

Specifically, I'm assuming:

  1. I shouldn't load the recogniser with hotwords file/score set?
  2. const char *hotwords is a path to a hotwords file, rather than a buffer containing the hotwords?

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

No branches or pull requests

2 participants