Skip to content

Commit

Permalink
Update #704 to not require a path parameter in Embeddings as not all …
Browse files Browse the repository at this point in the history
…vector models need a path. Update test.
  • Loading branch information
davidmezzetti committed May 25, 2024
1 parent e1ee9d8 commit f3b7cb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/python/txtai/embeddings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def configure(self, config):
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
Expand Down
2 changes: 1 addition & 1 deletion test/python/testoptional.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def testVectors(self):
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):
"""
Expand Down

0 comments on commit f3b7cb9

Please sign in to comment.