Support onnxruntime 1.18.0 (#906)
This commit is contained in:
@@ -28,11 +28,17 @@ def add_meta_data(filename: str, meta_data: Dict[str, str]):
|
||||
Key-value pairs.
|
||||
"""
|
||||
model = onnx.load(filename)
|
||||
|
||||
while len(model.metadata_props):
|
||||
model.metadata_props.pop()
|
||||
|
||||
for key, value in meta_data.items():
|
||||
meta = model.metadata_props.add()
|
||||
meta.key = key
|
||||
meta.value = str(value)
|
||||
|
||||
# model = onnx.version_converter.convert_version(model, 21)
|
||||
|
||||
onnx.save(model, filename)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user