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
2 changes: 2 additions & 0 deletions optimum/habana/transformers/generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,7 @@ def _contrastive_search(
do_padding = (
key_to_check is not None
and outputs.past_key_values[0][0].shape[2] == model_inputs[key_to_check].shape[1]
and generation_config.max_new_tokens > 1
)

if do_padding:
Expand Down Expand Up @@ -2843,6 +2844,7 @@ def _sample(
do_padding = (
key_to_check is not None
and outputs.past_key_values[0][0].shape[2] == model_inputs[key_to_check].shape[1]
and generation_config.max_new_tokens > 1
)

if do_padding:
Expand Down