Browse Source

2024.5.10-去除ITN的依赖构建

master
Administrator 1 year ago
parent
commit
134a33c991
1 changed files with 15 additions and 15 deletions
  1. +15
    -15
      decoder/params.h

+ 15
- 15
decoder/params.h

@ -261,21 +261,21 @@ std::shared_ptr InitDecodeResourceFromFlags() {
resource->post_processor =
std::make_shared<PostProcessor>(std::move(post_process_opts));
if (!FLAGS_itn_model_dir.empty()) { // With ITN
std::string itn_tagger_path =
wenet::JoinPath(FLAGS_itn_model_dir, "zh_itn_tagger.fst");
std::string itn_verbalizer_path =
wenet::JoinPath(FLAGS_itn_model_dir, "zh_itn_verbalizer.fst");
if (wenet::FileExists(itn_tagger_path) &&
wenet::FileExists(itn_verbalizer_path)) {
LOG(INFO) << "Reading ITN fst" << FLAGS_itn_model_dir;
post_process_opts.itn = true;
auto postprocessor =
std::make_shared<wenet::PostProcessor>(std::move(post_process_opts));
postprocessor->InitITNResource(itn_tagger_path, itn_verbalizer_path);
resource->post_processor = postprocessor;
}
}
// if (!FLAGS_itn_model_dir.empty()) { // With ITN
// std::string itn_tagger_path =
// wenet::JoinPath(FLAGS_itn_model_dir, "zh_itn_tagger.fst");
// std::string itn_verbalizer_path =
// wenet::JoinPath(FLAGS_itn_model_dir, "zh_itn_verbalizer.fst");
// if (wenet::FileExists(itn_tagger_path) &&
// wenet::FileExists(itn_verbalizer_path)) {
// LOG(INFO) << "Reading ITN fst" << FLAGS_itn_model_dir;
// post_process_opts.itn = true;
// auto postprocessor =
// std::make_shared<wenet::PostProcessor>(std::move(post_process_opts));
// postprocessor->InitITNResource(itn_tagger_path, itn_verbalizer_path);
// resource->post_processor = postprocessor;
// }
// }
return resource;
}

Loading…
Cancel
Save