💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Updated tests
davidmezzettidaf6f5b00919
diff --git a/test/python/testvectors.py b/test/python/testvectors.pyindex 02987ad4..09d61a72 100644--- a/test/python/testvectors.py+++ b/test/python/testvectors.py@@ -21,16 +21,25 @@ class TestVectors(unittest.TestCase):# Word vectors pathpath = os.path.join(tempfile.gettempdir(), "vectors")- # Build word vectors on README file- WordVectors.build("README.md", 300, 3, path)-# Save model pathself.path = path + ".magnitude"+ # Build word vectors, if they don't already exist+ if not os.path.exists(self.path):+ WordVectors.build("README.md", 300, 3, path)+def testLoad(self):+ """+ Test loading word vectors+ """+model = Vectors.create("words", self.path, True, None)self.assertEqual(len(model.transform((None, ["txtai"], None))), 300)def testLookup(self):+ """+ Test word vector lookup+ """+model = Vectors.create("words", self.path, True, None)self.assertEqual(model.lookup(["txtai", "embeddings", "sentence"]).shape, (3, 300))