Skip to content

Does model have state? #572

Answered by snakers4
lionsheep0724 asked this question in Q&A
Nov 7, 2024 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Why this happen? Does vad model has state, also?

Yes, it does, the VAD considers previous chunks.

State reset in ONNX wrapper, for example:

def reset_states(self, batch_size=1):
self._state = torch.zeros((2, batch_size, 128)).float()
self._context = torch.zeros(0)
self._last_sr = 0
self._last_batch_size = 0

When I initialize model at every request, vad process works properly.

The state should be reset each time the audio stream changes or ends.

Also for your use-case, you may find this discussion thread useful - #570 (comment)

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@lionsheep0724
Comment options

@snakers4
Comment options

@snakers4
Comment options

@lionsheep0724
Comment options

@snakers4
Comment options

Answer selected by lionsheep0724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants
Converted from issue

This discussion was converted from issue #571 on November 07, 2024 12:28.