Skip to content

Commit

Permalink
Fix loading models from cache (huggingface#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Jul 12, 2024
1 parent 7238e74 commit 9ef6766
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optimum/intel/openvino/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9ef6766

Please sign in to comment.