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 build script and tests to address issues with latest version of FastAPI, closes #380

davidmezzettiaba2d551d046
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0908a4d8..e96f40b9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -49,9 +49,8 @@ jobs:
- name: Build
run: |
- pip install -U pip
- pip install -U wheel coverage coveralls
- pip install .[all]
+ pip install -U pip wheel
+ pip install .[all,dev]
python -c "import nltk; nltk.download('punkt')"
python --version
make data coverage
diff --git a/setup.py b/setup.py
index 493cdbbe..a57236b1 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ install = ["faiss-cpu>=1.7.1.post2", "numpy>=1.18.4", "pyyaml>=5.3", "torch>=1.6
extras = {}
# Development dependencies - not included in "all" install
-extras["dev"] = ["black", "coverage", "mkdocs-material", "mkdocstrings[python-legacy]", "pre-commit", "pylint"]
+extras["dev"] = ["black", "coverage", "coveralls", "httpx", "mkdocs-material", "mkdocstrings[python-legacy]", "pre-commit", "pylint"]
extras["api"] = [
"aiohttp>=3.8.1",
diff --git a/test/python/testapi/testpipelines.py b/test/python/testapi/testpipelines.py
index e7c571bd..a60c1983 100644
--- a/test/python/testapi/testpipelines.py
+++ b/test/python/testapi/testpipelines.py
@@ -98,7 +98,7 @@ class TestPipelines(unittest.TestCase):
]
cls.text = (
- "Search is the base of many applications. Once data starts to pile up, users want to be able to find it. It’s the foundation "
+ "Search is the base of many applications. Once data starts to pile up, users want to be able to find it. It's the foundation "
"of the internet and an ever-growing challenge that is never solved or done. The field of Natural Language Processing (NLP) is "
"rapidly evolving with a number of new developments. Large-scale general language models are an exciting new capability "
"allowing us to add amazing functionality quickly with limited compute and people. Innovation continues with new models "
@@ -238,7 +238,7 @@ class TestPipelines(unittest.TestCase):
"""
summary = self.client.get(f"summary?text={urllib.parse.quote(self.text)}&minlength=15&maxlength=15").json()
- self.assertEqual(summary, "txtai is an AI-powered search engine that")
+ self.assertEqual(summary, "the field of natural language processing (NLP) is rapidly evolving")
def testSummaryBatch(self):
"""
@@ -246,7 +246,7 @@ class TestPipelines(unittest.TestCase):
"""
summaries = self.client.post("batchsummary", json={"texts": [self.text, self.text], "minlength": 15, "maxlength": 15}).json()
- self.assertEqual(summaries, ["txtai is an AI-powered search engine that"] * 2)
+ self.assertEqual(summaries, ["the field of natural language processing (NLP) is rapidly evolving"] * 2)
def testTabular(self):
"""
diff --git a/test/python/testpipeline/testsummary.py b/test/python/testpipeline/testsummary.py
index f0561a02..c3f74a50 100644
--- a/test/python/testpipeline/testsummary.py
+++ b/test/python/testpipeline/testsummary.py
@@ -19,7 +19,7 @@ class TestSummary(unittest.TestCase):
"""
cls.text = (
- "Search is the base of many applications. Once data starts to pile up, users want to be able to find it. It’s the foundation "
+ "Search is the base of many applications. Once data starts to pile up, users want to be able to find it. It's the foundation "
"of the internet and an ever-growing challenge that is never solved or done. The field of Natural Language Processing (NLP) is "
"rapidly evolving with a number of new developments. Large-scale general language models are an exciting new capability "
"allowing us to add amazing functionality quickly with limited compute and people. Innovation continues with new models "
@@ -34,7 +34,7 @@ class TestSummary(unittest.TestCase):
Test summarization of text
"""
- self.assertEqual(self.summary(self.text, minlength=15, maxlength=15), "txtai is an AI-powered search engine that")
+ self.assertEqual(self.summary(self.text, minlength=15, maxlength=15), "the field of natural language processing (NLP) is rapidly evolving")
def testSummaryBatch(self):
"""