Skip to main content

write_metadata_into_onnx

write_metadata_into_onnx(onnx_path: Union[str, Path], out_path: Union[str, Path], drop_old_meta: bool = False, **kwargs)

  • Description

    Write custom metadata into an ONNX model.

  • Parameters

    • onnx_path (Union[str, Path]): Path to the ONNX model.
    • out_path (Union[str, Path]): Path to the output ONNX model.
    • drop_old_meta (bool): Whether to drop old metadata. Default is False.
    • **kwargs: Custom metadata.
  • Example

    import docsaidkit as D

    onnx_path = 'model.onnx'
    out_path = 'model_with_metadata.onnx'
    D.write_metadata_into_onnx(
    onnx_path,
    out_path,
    drop_old_meta=False,
    key1='value1',
    key2='value2',
    key3='value3',
    )