diff --git a/optimum/onnxruntime/modeling_decoder.py b/optimum/onnxruntime/modeling_decoder.py index 1f18f70078c..bcb8f042279 100644 --- a/optimum/onnxruntime/modeling_decoder.py +++ b/optimum/onnxruntime/modeling_decoder.py @@ -789,7 +789,7 @@ def forward( if "position_ids" in self.inputs_names: if position_ids is None: raise ValueError("position_ids was not passed but is a required input for this ONNX model.") - onnx_inputs["position_ids"] = position_ids.cpu().detach().numpy() if use_torch else position_ids + inputs["position_ids"] = position_ids.cpu().detach().numpy() if use_torch else position_ids # Add the past_key_values to the decoder inputs if past_key_values is not None: