Closed megazone87 closed 4 months ago
Thank you for your first-time contribution!
Looks good to me. Will merge it after the CI tests get passed.
Could you build and test it locally?
The CI gives compilation errors:
[ 74%] Built target sherpa-online-websocket-client-microphone
/home/runner/work/sherpa/sherpa/sherpa/csrc/test-online-stream.cc: In member function ‘virtual void sherpa::OnlineStream_Test_Test::TestBody()’:
/home/runner/work/sherpa/sherpa/sherpa/csrc/test-online-stream.cc:35:40: error: no matching function for call to ‘sherpa::OnlineStream::OnlineStream(kaldifeat::FbankOptions&)’
35 | OnlineStream s(feat_config.fbank_opts);
| ^
In file included from /home/runner/work/sherpa/sherpa/sherpa/csrc/test-online-stream.cc:23:
/home/runner/work/sherpa/sherpa/sherpa/cpp_api/online-stream.h:61:12: note: candidate: ‘sherpa::OnlineStream::OnlineStream(const sherpa::FeatureConfig&, sherpa::ContextGraphPtr)’
61 | explicit OnlineStream(const FeatureConfig &feat_config,
| ^~~~~~~~~~~~
/home/runner/work/sherpa/sherpa/sherpa/cpp_api/online-stream.h:61:46: note: no known conversion for argument 1 from ‘kaldifeat::FbankOptions’ to ‘const sherpa::FeatureConfig&’
61 | explicit OnlineStream(const FeatureConfig &feat_config,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Please see https://github.com/k2-fsa/sherpa/actions/runs/8063891860/job/22026637645
I have made the changes and tested them locally. Can you restart the actions tests?
Thanks!
By setting --normalize-samples=false, you can invoke the model trained with Kaldi-style features.
Note: sherpa-offline supports setting this option from the command line, while sherpa-online does not support it. This PR is to enable command line setting support for sherpa-online.
Note 2: There are no changes related to pybind, server/client, triton (maybe) submitted here. If you think that 'Replace FbankOptions with FeatureConfig' is worth it (for this requirement or in the future), I am willing to make the necessary changes.