diff --git a/sherpa-onnx/csrc/keyword-spotter-transducer-impl.h b/sherpa-onnx/csrc/keyword-spotter-transducer-impl.h index ef22a9984..2d9964c98 100644 --- a/sherpa-onnx/csrc/keyword-spotter-transducer-impl.h +++ b/sherpa-onnx/csrc/keyword-spotter-transducer-impl.h @@ -68,6 +68,9 @@ class KeywordSpotterTransducerImpl : public KeywordSpotterImpl { : config_(config), model_(OnlineTransducerModel::Create(config.model_config)), sym_(config.model_config.tokens) { + + model_->SetFeatureDim(config.feat_config.feature_dim); + if (sym_.contains("")) { unk_id_ = sym_[""]; } @@ -85,6 +88,9 @@ class KeywordSpotterTransducerImpl : public KeywordSpotterImpl { : config_(config), model_(OnlineTransducerModel::Create(mgr, config.model_config)), sym_(mgr, config.model_config.tokens) { + + model_->SetFeatureDim(config.feat_config.feature_dim); + if (sym_.contains("")) { unk_id_ = sym_[""]; } diff --git a/sherpa-onnx/csrc/online-recognizer-transducer-impl.h b/sherpa-onnx/csrc/online-recognizer-transducer-impl.h index 3fc018daa..7908ec8ee 100644 --- a/sherpa-onnx/csrc/online-recognizer-transducer-impl.h +++ b/sherpa-onnx/csrc/online-recognizer-transducer-impl.h @@ -14,6 +14,8 @@ #include #include +#include + #if __ANDROID_API__ >= 9 #include @@ -122,6 +124,9 @@ class OnlineRecognizerTransducerImpl : public OnlineRecognizerImpl { model_(OnlineTransducerModel::Create(mgr, config.model_config)), sym_(mgr, config.model_config.tokens), endpoint_(config_.endpoint_config) { + + model_->SetFeatureDim(config.feat_config.feature_dim); + if (sym_.contains("")) { unk_id_ = sym_[""]; } @@ -153,6 +158,7 @@ class OnlineRecognizerTransducerImpl : public OnlineRecognizerImpl { #endif std::unique_ptr CreateStream() const override { + std::cout << "DEBUG, CreateStream(): " << config_.feat_config.ToString() << std::endl; auto stream = std::make_unique(config_.feat_config, hotwords_graph_); InitOnlineStream(stream.get());