diff --git a/optimum/intel/openvino/modeling_base.py b/optimum/intel/openvino/modeling_base.py index 9fbc73e85..b90e6285a 100644 --- a/optimum/intel/openvino/modeling_base.py +++ b/optimum/intel/openvino/modeling_base.py @@ -132,7 +132,11 @@ def fix_op_names_duplicates(model: openvino.runtime.Model): if isinstance(file_name, str): file_name = Path(file_name) - model = core.read_model(file_name) if not file_name.suffix == ".onnx" else convert_model(file_name) + model = ( + core.read_model(file_name.resolve(), file_name.with_suffix(".bin").resolve()) + if not file_name.suffix == ".onnx" + else convert_model(file_name) + ) if file_name.suffix == ".onnx": model = fix_op_names_duplicates(model) # should be called during model conversion to IR