Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudAshraf97 authored Dec 12, 2024
1 parent ce6e298 commit 4863a1f
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 @@ -302,13 +302,12 @@ def __call__(

batched_audio = batched_audio.reshape(-1, num_samples + context_size_samples)

batch_process_size = 10000
encoder_batch_size = 10000
num_segments = batched_audio.shape[0]
encoder_outputs = []
for start in range(0, num_segments, batch_process_size):
end = min(start + batch_process_size, num_segments)
for i in range(0, num_segments, encoder_batch_size):
encoder_output = self.encoder_session.run(
None, {"input": batched_audio[start:end]}
None, {"input": batched_audio[i : i + encoder_batch_size]}
)[0]
encoder_outputs.append(encoder_output)

Expand Down

0 comments on commit 4863a1f

Please sign in to comment.