mirror of
https://github.com/neuml/txtai.git
synced 2026-10-12 02:19:52 +00:00
Fix incompatibility with ONNX models and transformers>=4.41.0, closes #720
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user