convert

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package convert wraps external model conversion tools (optimum-cli, coremltools) as subprocess calls. CKV does not implement conversion logic itself — it delegates to well-tested Python tools.

Supported conversions:

  • PyTorch/SafeTensors → ONNX (via HuggingFace optimum-cli)
  • ONNX → CoreML .mlpackage (via Apple coremltools)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectFormat

func DetectFormat(modelDir string) (hasONNX, hasCoreML, hasSafeTensors bool)

DetectFormat inspects a model directory and returns which formats are available.

func ToCoreML

func ToCoreML(ctx context.Context, inputPath, outputPath string) error

ToCoreML converts an ONNX model to CoreML .mlpackage format using coremltools. inputPath is the path to model.onnx. outputPath is the destination .mlpackage directory.

Requires: pip install coremltools

func ToONNX

func ToONNX(ctx context.Context, modelID, outputDir string) error

ToONNX converts a HuggingFace model to ONNX format using optimum-cli. modelID is the HuggingFace model identifier (e.g. "BAAI/bge-m3") or a local directory containing a PyTorch model. outputDir receives the converted ONNX files.

Requires: pip install optimum[exporters]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL