RNNLM model support lm_num_thread and lm_provider setting (#173)
* rnnlm model inference supports num_threads setting * rnnlm params decouple num_thread and provider with Transducer. * fix python csrc bug which offline-lm-config.cc and online-lm-config.cc arguments problem * lm_num_threads and lm_provider set default values --------- Co-authored-by: cuidongcai1035 <cuidongcai1035@wezhuiyi.com>
This commit is contained in:
@@ -18,12 +18,12 @@ namespace sherpa_onnx {
|
||||
|
||||
class OfflineRnnLM::Impl {
|
||||
public:
|
||||
explicit Impl(const OfflineRecognizerConfig &config)
|
||||
: config_(config.lm_config),
|
||||
explicit Impl(const OfflineLMConfig &config)
|
||||
: config_(config),
|
||||
env_(ORT_LOGGING_LEVEL_ERROR),
|
||||
sess_opts_{GetSessionOptions(config.model_config)},
|
||||
sess_opts_{GetSessionOptions(config)},
|
||||
allocator_{} {
|
||||
Init(config.lm_config);
|
||||
Init(config);
|
||||
}
|
||||
|
||||
Ort::Value Rescore(Ort::Value x, Ort::Value x_lens) {
|
||||
@@ -63,7 +63,7 @@ class OfflineRnnLM::Impl {
|
||||
std::vector<const char *> output_names_ptr_;
|
||||
};
|
||||
|
||||
OfflineRnnLM::OfflineRnnLM(const OfflineRecognizerConfig &config)
|
||||
OfflineRnnLM::OfflineRnnLM(const OfflineLMConfig &config)
|
||||
: impl_(std::make_unique<Impl>(config)) {}
|
||||
|
||||
OfflineRnnLM::~OfflineRnnLM() = default;
|
||||
|
||||
Reference in New Issue
Block a user