Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions whisperx/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ def generate_segment_batched(
)

encoder_output = self.encode(features)

max_initial_timestamp_index = int(
round(options.max_initial_timestamp / self.time_precision)
)


result = self.model.generate(
encoder_output,
[prompt] * batch_size,
Expand All @@ -72,11 +68,13 @@ def generate_segment_batched(
max_length=self.max_length,
suppress_blank=options.suppress_blank,
suppress_tokens=options.suppress_tokens,
no_repeat_ngram_size=options.no_repeat_ngram_size,
repetition_penalty=options.repetition_penalty,
)

tokens_batch = [x.sequences_ids[0] for x in result]

def decode_batch(tokens: List[List[int]]) -> str:
def decode_batch(tokens: List[List[int]]) -> List[str]:
res = []
for tk in tokens:
res.append([token for token in tk if token < tokenizer.eot])
Expand Down