Skip to content

Commit fc20148

Browse files
author
Hualiang Xie (from Dev Box)
committed
dedup _get_model_external_data_paths
1 parent 3adbe7c commit fc20148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

optimum/onnx/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _get_model_external_data_paths(model_path: Path) -> List[Path]:
8484
for tensor in model_tensors
8585
if tensor.HasField("data_location") and tensor.data_location == onnx.TensorProto.EXTERNAL
8686
]
87-
return [model_path.parent / tensor_name for tensor_name in model_tensors_ext]
87+
return list(dict.fromkeys([model_path.parent / tensor_name for tensor_name in model_tensors_ext]))
8888

8989

9090
def check_model_uses_external_data(model: onnx.ModelProto) -> bool:

0 commit comments

Comments
 (0)