Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update tests

davidmezzetti0aee1b089324
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9e6b361f..7fdaab72 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,7 +23,7 @@ jobs:
- name: Install dependencies - Windows
run: |
python -m pip install torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip install git+https://github.com/huggingface/transformers
+ pip install git+https://github.com/huggingface/transformers@5e637e6c690e45d13ebf7296e1ea9dcc188d0f07
if: matrix.os == 'windows-latest'
- name: Build
diff --git a/test/python/testvectors.py b/test/python/testvectors.py
index e4afd37a..e2e1772d 100644
--- a/test/python/testvectors.py
+++ b/test/python/testvectors.py
@@ -13,22 +13,6 @@ class TestVectors(unittest.TestCase):
Vectors tests
"""
- @staticmethod
- def setUpClass():
- """
- Test a WordVectors build.
- """
-
- # Word vectors path
- path = os.path.join(tempfile.gettempdir(), "vectors")
-
- # Save model path
- vectors = path + ".magnitude"
-
- # Build word vectors, if they don't already exist
- if not os.path.exists(vectors):
- WordVectors.build("LICENSE", 300, 3, path)
-
def setUp(self):
"""
Test a WordVectors build.
@@ -40,6 +24,10 @@ class TestVectors(unittest.TestCase):
# Save model path
self.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
@@ -54,4 +42,4 @@ class TestVectors(unittest.TestCase):
"""
model = Vectors.create("words", self.path, True, None)
- self.assertEqual(model.lookup(["txtai", "embeddings", "sentence"]).shape, (3, 300))
+ self.assertEqual(model.lookup(["txtai", "embeddings", "sentence"]).shape, (3, 300))
\ No newline at end of file