💡 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
Update tests to improve memory cleanup
davidmezzettid21d00acc5ab
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 3b154ca2..721b06bb 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -8,7 +8,7 @@ jobs:runs-on: ${{ matrix.os }}strategy:matrix:- os: [ubuntu-latest, macos-10.15, windows-latest]+ os: [ubuntu-latest, macos-latest, windows-latest]steps:- uses: actions/checkout@v2@@ -27,7 +27,7 @@ jobs:run: |brew install libomppip install annoy==1.16.3- if: matrix.os == 'macos-10.15'+ if: matrix.os == 'macos-latest'- name: Install dependencies - Windowsrun: choco install wgetdiff --git a/test/python/testpipeline/testentity.py b/test/python/testpipeline/testentity.pyindex 2d49b963..1335de82 100644--- a/test/python/testpipeline/testentity.py+++ b/test/python/testpipeline/testentity.py@@ -14,8 +14,20 @@ class TestEntity(unittest.TestCase):@classmethoddef setUpClass(cls):+ """+ Create entity instance.+ """+cls.entity = Entity("dslim/bert-base-NER")+ @classmethod+ def tearDownClass(cls):+ """+ Cleanup data.+ """++ cls.entity = None+def testEntity(self):"""Test entitydiff --git a/test/python/testpipeline/testextractor.py b/test/python/testpipeline/testextractor.pyindex 01cf5c6c..6dfc01d7 100644--- a/test/python/testpipeline/testextractor.py+++ b/test/python/testpipeline/testextractor.py@@ -50,6 +50,8 @@ class TestExtractor(unittest.TestCase):if cls.embeddings:cls.embeddings.close()+ cls.extractor = None+def testAnswer(self):"""Test qa extraction with an answerdiff --git a/test/python/testpipeline/testlabels.py b/test/python/testpipeline/testlabels.pyindex cb46599b..57178d08 100644--- a/test/python/testpipeline/testlabels.py+++ b/test/python/testpipeline/testlabels.py@@ -30,6 +30,15 @@ class TestLabels(unittest.TestCase):cls.labels = Labels("prajjwal1/bert-medium-mnli")cls.similarity = Similarity(model=cls.labels)+ @classmethod+ def tearDownClass(cls):+ """+ Cleanup data.+ """++ cls.labels = None+ cls.similarity = None+def testLabel(self):"""Test labels with single text inputdiff --git a/test/python/testpipeline/testsummary.py b/test/python/testpipeline/testsummary.pyindex 8d51f88d..ac5a82dd 100644--- a/test/python/testpipeline/testsummary.py+++ b/test/python/testpipeline/testsummary.py@@ -15,7 +15,7 @@ class TestSummary(unittest.TestCase):@classmethoddef setUpClass(cls):"""- Create single summary instance+ Create single summary instance."""cls.text = (@@ -29,6 +29,14 @@ class TestSummary(unittest.TestCase):cls.summary = Summary("t5-small")+ @classmethod+ def tearDownClass(cls):+ """+ Cleanup data.+ """++ cls.summary = None+def testSummary(self):"""Test summarization of textdiff --git a/test/python/testvectors/testtransformers.py b/test/python/testvectors/testtransformers.pyindex 85c065dd..6d28cbb0 100644--- a/test/python/testvectors/testtransformers.py+++ b/test/python/testvectors/testtransformers.py@@ -23,6 +23,14 @@ class TestTransformersVectors(unittest.TestCase):cls.model = VectorsFactory.create({"path": "sentence-transformers/nli-mpnet-base-v2"}, None)+ @classmethod+ def tearDownClass(cls):+ """+ Cleanup data+ """++ cls.model = None+def testIndex(self):"""Test transformers indexing