💡 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
Reduce number of vector process indexers for unit test
davidmezzetti9461d2813a74
diff --git a/test/python/testembeddings.py b/test/python/testembeddings.pyindex be047ee1..9e455c34 100644--- a/test/python/testembeddings.py+++ b/test/python/testembeddings.py@@ -8,6 +8,8 @@ import osimport tempfileimport unittest+from unittest.mock import patch+import numpy as npfrom txtai.embeddings import Embeddings@@ -155,11 +157,15 @@ class TestEmbeddings(unittest.TestCase):self.assertEqual(uid, 0)- def testWords(self):+ @patch("os.cpu_count")+ def testWords(self, cpucount):"""Test embeddings backed by word vectors"""+ # Mock CPU count+ cpucount.return_value = 2+# Initialize model pathpath = os.path.join(tempfile.gettempdir(), "model")os.makedirs(path, exist_ok=True)