Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update #704 to not require a path parameter in Embeddings as not all vector models need a path. Update test.

davidmezzettif3b7cb9569eb
diff --git a/src/python/txtai/embeddings/base.py b/src/python/txtai/embeddings/base.py
index 3104437b..bc430a2d 100644
--- a/src/python/txtai/embeddings/base.py
+++ b/src/python/txtai/embeddings/base.py
@@ -744,7 +744,7 @@ class Embeddings:
self.scoring = self.createscoring() if scoring and (not isinstance(scoring, dict) or not scoring.get("terms")) else None
# Dense vectors - transforms data to embeddings vectors
- self.model = self.loadvectors() if self.config and self.config.get("path") else None
+ self.model = self.loadvectors() if self.config else None
# Query model
self.query = self.loadquery() if self.config else None
diff --git a/test/python/testoptional.py b/test/python/testoptional.py
index cac20266..e1d81563 100644
--- a/test/python/testoptional.py
+++ b/test/python/testoptional.py
@@ -253,7 +253,7 @@ class TestOptional(unittest.TestCase):
VectorsFactory.create({"method": "words"}, None)
with self.assertRaises(ImportError):
- VectorsFactory.create({"method": "sentence-transformers", "path": ""}, None)
+ VectorsFactory.create({"method": "sentence-transformers", "path": "sentence-transformers/nli-mpnet-base-v2"}, None)
def testWorkflow(self):
"""