💡 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
Skip word vector embeddings test on macOS
davidmezzetti3ac6a5b332f3
diff --git a/test/python/testembeddings.py b/test/python/testembeddings.pyindex 9e455c34..0923bc4d 100644--- a/test/python/testembeddings.py+++ b/test/python/testembeddings.py@@ -5,11 +5,10 @@ Embeddings module testsimport contextlibimport ioimport os+import platformimport tempfileimport unittest-from unittest.mock import patch-import numpy as npfrom txtai.embeddings import Embeddings@@ -157,15 +156,12 @@ class TestEmbeddings(unittest.TestCase):self.assertEqual(uid, 0)- @patch("os.cpu_count")- def testWords(self, cpucount):+ @unittest.skipIf(platform.system() == "Darwin", "Word vector embeddings tests skipped on macOS")+ def testWords(self):"""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)diff --git a/test/python/testvectors/testwordvectors.py b/test/python/testvectors/testwordvectors.pyindex 9c072dbc..cc4d7747 100644--- a/test/python/testvectors/testwordvectors.py+++ b/test/python/testvectors/testwordvectors.py@@ -3,11 +3,10 @@ Vectors module tests"""import os+import platformimport tempfileimport unittest-from unittest.mock import patch-from txtai.vectors import WordVectors, VectorsFactory@@ -47,15 +46,12 @@ class TestWordVectors(unittest.TestCase):self.assertTrue(model.initialized)- @patch("os.cpu_count")- def testIndex(self, cpucount):+ @unittest.skipIf(platform.system() == "Darwin", "Word vector embeddings tests skipped on macOS")+ def testIndex(self):"""- Test word vector indexing+ Test word vectors indexing"""- # Mock CPU count- cpucount.return_value = 2-# Generate datadocuments = [(x, "This is a test", None) for x in range(1000)]