Skip to content

Commit

Permalink
Fix whisper compile (#35413)
Browse files Browse the repository at this point in the history
Fix compile error

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
  • Loading branch information
jiqing-feng authored Jan 13, 2025
1 parent cd44bdb commit b8c34d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/whisper/generation_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ def detect_language(
)

with torch.no_grad():
logits = self(**inputs, decoder_input_ids=decoder_input_ids).logits[:, -1]
logits = self(**inputs, decoder_input_ids=decoder_input_ids, use_cache=False).logits[:, -1]

non_lang_mask = torch.ones_like(logits[0], dtype=torch.bool)
non_lang_mask[list(generation_config.lang_to_id.values())] = False
Expand Down

0 comments on commit b8c34d9

Please sign in to comment.