Skip to content

Commit

Permalink
speaker-identification-with-vad-non-streaming-asr.py Lack of support …
Browse files Browse the repository at this point in the history
…for sense_voice. (#1884)
  • Loading branch information
luffy-git authored Feb 18, 2025
1 parent 26d5f1f commit 4e83b34
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 4e83b34

Please sign in to comment.