Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 64ef340

Browse files
committedOct 21, 2024
fix cutting position ids
1 parent f4d2544 commit 64ef340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎optimum/intel/openvino/modeling_decoder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ def prepare_inputs(
504504
else:
505505
position_ids = np.cumsum(attention_mask, axis=1) - 1
506506
position_ids[attention_mask == 0] = 1
507-
if past_key_values:
508-
position_ids = position_ids[:, -input_ids.shape[1] :]
507+
if past_key_values:
508+
position_ids = position_ids[:, -input_ids.shape[1] :]
509509

510510
inputs["position_ids"] = position_ids
511511

0 commit comments

Comments
 (0)
Please sign in to comment.