VibeVoice
VibeVoice copied to clipboard
refactor: harden python runtime checks and typing in modular components
What I changed
Type-hint correctness + import hygiene
vibevoice/modular/streamer.py
- Replaced
Optional[any]withOptional[Any] - Added
Anyimport - Moved inline
import timeto module scope
Production-safe runtime checks
vibevoice/modular/modeling_vibevoice.py
vibevoice/modular/modeling_vibevoice_asr.py
vibevoice/modular/modeling_vibevoice_streaming.py
- Replaced
assert Falsefallback with explicitRuntimeErrorin embedding lookup path
Clear input validation in inference
vibevoice/modular/modeling_vibevoice_streaming_inference.py
- Replaced
assert batch_size == 1withValueErrorincluding actual batch size
Safer checkpoint conversion
vibevoice/scripts/convert_nnscaler_checkpoint_to_transformers.py
- Made
torch.load(..., weights_only=False)explicit - Wrapped temporary dtype override in
try/finallyso dtype is always restored on failures
@microsoft-github-policy-service agree
Hi! This PR is ready for review.
Workflows are awaiting approval—could a maintainer please approve them? Thanks!
Python runtime checks and typing hardening in modular components. Type safety improvements — good practice. If tests pass, ready to merge.