This commit is contained in:
Fangjun Kuang
2024-01-04 12:32:19 +08:00
committed by GitHub
parent e215d0c39a
commit 547a22f7d9

View File

@@ -862,6 +862,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
max_active_paths=args.max_active_paths, max_active_paths=args.max_active_paths,
hotwords_file=args.hotwords_file, hotwords_file=args.hotwords_file,
hotwords_score=args.hotwords_score, hotwords_score=args.hotwords_score,
provider=args.provider,
) )
elif args.paraformer: elif args.paraformer:
assert len(args.nemo_ctc) == 0, args.nemo_ctc assert len(args.nemo_ctc) == 0, args.nemo_ctc
@@ -879,6 +880,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
sample_rate=args.sample_rate, sample_rate=args.sample_rate,
feature_dim=args.feat_dim, feature_dim=args.feat_dim,
decoding_method=args.decoding_method, decoding_method=args.decoding_method,
provider=args.provider,
) )
elif args.nemo_ctc: elif args.nemo_ctc:
assert len(args.wenet_ctc) == 0, args.wenet_ctc assert len(args.wenet_ctc) == 0, args.wenet_ctc
@@ -895,6 +897,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
sample_rate=args.sample_rate, sample_rate=args.sample_rate,
feature_dim=args.feat_dim, feature_dim=args.feat_dim,
decoding_method=args.decoding_method, decoding_method=args.decoding_method,
provider=args.provider,
) )
elif args.wenet_ctc: elif args.wenet_ctc:
assert len(args.whisper_encoder) == 0, args.whisper_encoder assert len(args.whisper_encoder) == 0, args.whisper_encoder
@@ -910,6 +913,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
sample_rate=args.sample_rate, sample_rate=args.sample_rate,
feature_dim=args.feat_dim, feature_dim=args.feat_dim,
decoding_method=args.decoding_method, decoding_method=args.decoding_method,
provider=args.provider,
) )
elif args.whisper_encoder: elif args.whisper_encoder:
assert len(args.tdnn_model) == 0, args.tdnn_model assert len(args.tdnn_model) == 0, args.tdnn_model
@@ -925,6 +929,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
language=args.whisper_language, language=args.whisper_language,
task=args.whisper_task, task=args.whisper_task,
tail_paddings=args.whisper_tail_paddings, tail_paddings=args.whisper_tail_paddings,
provider=args.provider,
) )
elif args.tdnn_model: elif args.tdnn_model:
assert_file_exists(args.tdnn_model) assert_file_exists(args.tdnn_model)
@@ -936,6 +941,7 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
feature_dim=args.feat_dim, feature_dim=args.feat_dim,
num_threads=args.num_threads, num_threads=args.num_threads,
decoding_method=args.decoding_method, decoding_method=args.decoding_method,
provider=args.provider,
) )
else: else:
raise ValueError("Please specify at least one model") raise ValueError("Please specify at least one model")