| | |
| | | TCLAP::ValueArg<std::int32_t> thread_num("", THREAD_NUM, "multi-thread num for rtf", false, 1, "int32_t"); |
| | | TCLAP::ValueArg<std::string> hotword("", HOTWORD, "the hotword file, one hotword perline, Format: Hotword Weight (could be: 阿里巴巴 20)", false, "", "string"); |
| | | TCLAP::SwitchArg use_gpu("", INFER_GPU, "Whether to use GPU for inference, default is false", false); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", "batch-size", "batch_size for ASR model when using GPU", false, 1, "int32_t"); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", BATCHSIZE, "batch_size for ASR model when using GPU", false, 1, "int32_t"); |
| | | |
| | | cmd.add(model_dir); |
| | | cmd.add(quantize); |
| | |
| | | TCLAP::ValueArg<std::int32_t> audio_fs("", AUDIO_FS, "the sample rate of audio", false, 16000, "int32_t"); |
| | | TCLAP::ValueArg<std::string> hotword("", HOTWORD, "the hotword file, one hotword perline, Format: Hotword Weight (could be: 阿里巴巴 20)", false, "", "string"); |
| | | TCLAP::SwitchArg use_gpu("", INFER_GPU, "Whether to use GPU for inference, default is false", false); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", "batch-size", "batch_size for ASR model when using GPU", false, 5, "int32_t"); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", BATCHSIZE, "batch_size for ASR model when using GPU", false, 5, "int32_t"); |
| | | |
| | | cmd.add(model_dir); |
| | | cmd.add(quantize); |
| | |
| | | #define QUANT_MODEL_NAME "model_quant.onnx" |
| | | // gpu models |
| | | #define INFER_GPU "gpu" |
| | | #define BATCHSIZE "batch-size" |
| | | #define TORCH_MODEL_NAME "model.torchscripts" |
| | | #define TORCH_QUANT_MODEL_NAME "model_quant.torchscripts" |
| | | #define BLADE_MODEL_NAME "model.blade.fp16.pt" |
| | |
| | | if(asr_feats.size() != 0){ |
| | | LfrCmvn(asr_feats); |
| | | } |
| | | int32_t num_frames = asr_feats.size() / feature_dim; |
| | | int32_t num_frames = asr_feats.size(); |
| | | paraformer_length.emplace_back(num_frames); |
| | | if(max_size < asr_feats.size()){ |
| | | max_size = asr_feats.size(); |
| | | if(max_size < asr_feats.size()*feature_dim){ |
| | | max_size = asr_feats.size()*feature_dim; |
| | | max_frames = num_frames; |
| | | } |
| | | |
| | |
| | | TCLAP::ValueArg<std::int32_t> fst_inc_wts("", FST_INC_WTS, |
| | | "the fst hotwords incremental bias", false, 20, "int32_t"); |
| | | TCLAP::SwitchArg use_gpu("", INFER_GPU, "Whether to use GPU, default is false", false); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", "batch-size", "batch_size for ASR model when using GPU", false, 5, "int32_t"); |
| | | TCLAP::ValueArg<std::int32_t> batch_size("", BATCHSIZE, "batch_size for ASR model when using GPU", false, 5, "int32_t"); |
| | | |
| | | // add file |
| | | cmd.add(hotword); |