re-pull-request allow tokens and hotwords be loaded from buffered string driectly (#1339)

Co-authored-by: xiao <shawl336@163.com>
This commit is contained in:
lxiao336
2024-09-13 09:58:17 +08:00
committed by GitHub
parent 6b6e7635ed
commit 65cfa7548a
12 changed files with 414 additions and 16 deletions

View File

@@ -45,6 +45,11 @@ struct OnlineModelConfig {
std::string modeling_unit = "cjkchar";
std::string bpe_vocab;
/// if tokens_buf is non-empty,
/// the tokens will be loaded from the buffered string instead of from the
/// ${tokens} file
std::string tokens_buf;
OnlineModelConfig() = default;
OnlineModelConfig(const OnlineTransducerModelConfig &transducer,
const OnlineParaformerModelConfig &paraformer,
@@ -53,8 +58,7 @@ struct OnlineModelConfig {
const OnlineNeMoCtcModelConfig &nemo_ctc,
const ProviderConfig &provider_config,
const std::string &tokens, int32_t num_threads,
int32_t warm_up, bool debug,
const std::string &model_type,
int32_t warm_up, bool debug, const std::string &model_type,
const std::string &modeling_unit,
const std::string &bpe_vocab)
: transducer(transducer),