Skip to content

feat(vad): add Silero VAD adapter - #3494

Merged
LauraGPT merged 3 commits into
modelscope:mainfrom
wuhongsheng:silero_vad
Aug 14, 2026
Merged

feat(vad): add Silero VAD adapter#3494
LauraGPT merged 3 commits into
modelscope:mainfrom
wuhongsheng:silero_vad

Conversation

@wuhongsheng

Copy link
Copy Markdown
Contributor

Summary

  • add vad_model="silero-vad" backed by the official silero-vad Python package
  • preserve the existing AutoModel VAD → ASR pipeline contract by returning millisecond segments
  • add optional dependency, documentation, and focused tests

Validation

  • python -m pytest -q tests/test_silero_vad_adapter.py
  • README example tested with cloth_20220629_clean_01.wav (non-empty transcript and 329 timestamps)

@LauraGPT

Copy link
Copy Markdown
Collaborator

Maintainer validation completed on e8ea59a02c9362ae78e6730ca574862f5aedd6c7. I pushed two focused fixes before moving this out of draft:

  • keep TorchScript input tensors on the adapter/model device so CUDA ASR + Silero VAD does not mix a CUDA model with CPU audio
  • keep ONNX input tensors on CPU because the official wrapper calls Tensor.numpy()
  • reject negative and sub-millisecond max segment values that would otherwise produce a zero-width split loop
  • add the optional Silero path to the main English README

Validation:

  • python -m pytest -q tests/test_silero_vad_adapter.py -> 7 passed with silero-vad==6.2.1
  • real 70.47 s WAV through the TorchScript alias -> 42 valid segments
  • the same WAV through silero_onnx=True with onnxruntime==1.28.0 -> 42 valid segments
  • Black check, py_compile, and git diff --check passed
  • repository contract check passed

@LauraGPT
LauraGPT marked this pull request as ready for review August 14, 2026 07:39

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the final maintainer-tested head. TorchScript and ONNX device behavior, segment bounds, optional dependency path, and documentation are covered.

@LauraGPT
LauraGPT merged commit 9041074 into modelscope:main Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants