From b6f7e7430e90ef4ae50da79b5fa14f73598105da Mon Sep 17 00:00:00 2001 From: IlyasMoutawwakil Date: Mon, 6 Jan 2025 12:17:47 +0100 Subject: [PATCH] revert --- optimum/intel/openvino/modeling_visual_language.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/optimum/intel/openvino/modeling_visual_language.py b/optimum/intel/openvino/modeling_visual_language.py index d0b281e19..1c0e35cca 100644 --- a/optimum/intel/openvino/modeling_visual_language.py +++ b/optimum/intel/openvino/modeling_visual_language.py @@ -166,6 +166,9 @@ def prepare_inputs( if past_len: position_ids = position_ids[:, -inputs_embeds.shape[1] :] + if self.config.model_type == "qwen2_vl" and position_ids.ndim != 3: + position_ids = np.repeat(np.expand_dims(position_ids, 0), 3, axis=0) + inputs["position_ids"] = position_ids if "beam_idx" in self.input_names: