Skip to content

Commit

Permalink
Fix a bug for large models in onnx importer. (#3875)
Browse files Browse the repository at this point in the history
The method `onnx.load_external_data_for_model` function does not admit
`pathlib.Path` as an input.
  • Loading branch information
zjgarvey authored Nov 15, 2024
1 parent 0eba539 commit c26ca8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/torch_mlir/tools/import_onnx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def load_onnx_model(args: argparse.Namespace) -> onnx.ModelProto:
# Load the temp file and the external data.
inferred_model = onnx.load(temp_inferred_file, load_external_data=False)
data_dir = Path(input_dir if args.temp_dir is None else args.data_dir)
onnx.load_external_data_for_model(inferred_model, data_dir)
onnx.load_external_data_for_model(inferred_model, str(data_dir))

# Remove the inferred shape file unless asked to keep it
if not args.keep_temps:
Expand Down

0 comments on commit c26ca8b

Please sign in to comment.