Exporters
Functions and utilities for exporting models to RKNN format.
Export Functions
- rktransformers.exporters.rknn.convert.export_rknn(config)[source]
Export ONNX model or Hugging Face model to RKNN using the provided configuration.
For Hugging Face models, this function:
Exports to ONNX using Optimum (automatically detects required inputs like token_type_ids)
Inspects the exported ONNX model to determine actual inputs
Configures RKNN toolkit with optimization and quantization settings
Loads and converts the ONNX model to RKNN format
Optionally quantizes using calibration dataset
Exports to RKNN format and saves complete configuration
- Parameters:
config (RKNNConfig) – RKNN configuration object
- Returns:
None on success, raises RuntimeError on failure
- Return type:
None