MLOnnx
Exports a traditional machine learning model (i.e. scikit-learn) to ONNX.
Example
See the link below for a detailed example.
Notebook | Description | |
---|---|---|
Export and run other machine learning models | Export and run models from scikit-learn, PyTorch and more |
Methods
Python documentation for the pipeline.
Exports a machine learning model to ONNX using ONNXMLTools.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
model to export |
required | |
task |
optional model task or category |
'default'
|
|
output |
optional output model path, defaults to return byte array if None |
None
|
|
opset |
onnx opset, defaults to 12 |
12
|
Returns:
Type | Description |
---|---|
path to model output or model as bytes depending on output parameter |
Source code in txtai/pipeline/train/mlonnx.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|