Fix incompatibility with ONNX models and transformers>=4.41.0, closes #720

This commit is contained in:
davidmezzetti
2024-05-20 17:10:50 -04:00
parent 03057f2040
commit c4080a348a
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -13,6 +13,7 @@ from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from txtai.embeddings import Embeddings
from txtai.models import OnnxModel
from txtai.pipeline import HFOnnx, HFTrainer, Labels, MLOnnx, Questions
@@ -41,6 +42,9 @@ class TestOnnx(unittest.TestCase):
# Validate model has data
self.assertGreater(len(model), 0)
# Validate model device properly works
self.assertEqual(OnnxModel(model).device, -1)
def testClassification(self):
"""
Test exporting a classification model to ONNX and running inference