Skip to content

Commit

Permalink
Fix incompatibility between latest skl2onnx and txtai, closes #729
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed May 31, 2024
1 parent 12fa4f9 commit 5221f73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/python/txtai/pipeline/train/mlonnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ def __call__(self, model, task="default", output=None, opset=12):

# Find probabilities output node and rename to logits
for node in model.graph.node:
if node.output[0] == "probabilities":
node.output[0] = "logits"
for x, _ in enumerate(node.output):
if node.output[x] == "probabilities":
node.output[x] = "logits"

# Save model to specified output path or return bytes
model = save_onnx_model(model, output)
Expand Down

0 comments on commit 5221f73

Please sign in to comment.