Skip to content

Commit 34ba105

Browse files
committed
Fix import error with latest version of onnx, closes #907
1 parent 77eb913 commit 34ba105

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Build
5050
run: |
5151
pip install -U wheel
52-
pip install .[all,dev] onnx==1.17.0 skl2onnx==1.18.0
52+
pip install .[all,dev]
5353
pip cache purge
5454
python -c "import nltk; nltk.download(['punkt', 'punkt_tab', 'averaged_perceptron_tagger_eng'])"
5555
python --version

src/python/txtai/pipeline/train/mlonnx.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
from ..base import Pipeline
66

77
try:
8+
# Workaround for issue with onnx 1.18 and onnxmltools 1.13
9+
import onnx
10+
11+
onnx.helper.split_complex_to_pairs = None
12+
813
from onnxmltools import convert_sklearn
9-
from onnxmltools.convert.common.data_types import StringTensorType
1014

15+
from skl2onnx.common.data_types import StringTensorType
1116
from skl2onnx.helpers.onnx_helper import save_onnx_model, select_model_inputs_outputs
1217

1318
ONNX_MLTOOLS = True

0 commit comments

Comments
 (0)