Skip to content

Commit

Permalink
ㄹ SileroVADModel
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonlight committed Jun 28, 2024
1 parent 33bd271 commit 9ab50ce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions faster_whisper/vad.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ def get_initial_states(self, batch_size: int):
return state, context

def __call__(self, x, states, sr: int):
state, context = states

if len(x.shape) == 1:
x = np.expand_dims(x, 0)
if len(x.shape) > 2:
Expand All @@ -264,8 +266,6 @@ def __call__(self, x, states, sr: int):
)
if sr / x.shape[1] > 31.25:
raise ValueError("Input audio chunk is too short")

state, context = states

ort_inputs = {
"input": x,
Expand All @@ -274,6 +274,5 @@ def __call__(self, x, states, sr: int):
}

out, state = self.session.run(None, ort_inputs)
out = np.array(out, dtype='float32')

return out, state
return out, states

0 comments on commit 9ab50ce

Please sign in to comment.