Skip to content

Commit

Permalink
make style
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilakesbi committed Jul 18, 2024
1 parent ed8cc34 commit 6b7b3d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/transformers/models/whisper/generation_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,13 @@ def generate(
if is_shortform:
# add eos token:
if generation_config.max_new_tokens is None and generation_config.max_length is None:

eos_tokens = torch.full((sequences.shape[0], 1,), generation_config.eos_token_id).to(sequences.device)
eos_tokens = torch.full(
(
sequences.shape[0],
1,
),
generation_config.eos_token_id,
).to(sequences.device)
sequences = torch.cat([sequences, eos_tokens], dim=-1)

if return_token_timestamps:
Expand Down

0 comments on commit 6b7b3d6

Please sign in to comment.