Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

speaker-identification-with-vad-non-streaming-asr.py Lack of support for sense_voice. #1884

Merged
merged 4 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ def register_non_streaming_asr_model_args(parser):
help="Feature dimension. Must match the one expected by the model",
)

parser.add_argument(
"--sense-voice",
default="",
type=str,
help="Path to sense voice model",
)


def get_args():
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -317,6 +324,15 @@ def create_recognizer(args) -> sherpa_onnx.OfflineRecognizer:
task=args.whisper_task,
tail_paddings=args.whisper_tail_paddings,
)
elif args.sense_voice:
assert_file_exists(args.sense_voice)
recognizer = sherpa_onnx.OfflineRecognizer.from_sense_voice(
model=args.sense_voice,
tokens=args.tokens,
num_threads=args.num_threads,
use_itn=True,
debug=args.debug,
)
else:
raise ValueError("Please specify at least one model")

Expand Down