mirror of
https://github.com/neuml/txtai.git
synced 2026-10-12 02:19:52 +00:00
34 lines
674 B
Python
34 lines
674 B
Python
"""
|
|
Milvus ANN module tests
|
|
"""
|
|
|
|
from txtai.ann import ANNFactory
|
|
|
|
from .base import DenseTest
|
|
|
|
|
|
class TestMilvus(DenseTest):
|
|
"""
|
|
Milvus ANN tests.
|
|
"""
|
|
|
|
def testMilvus(self):
|
|
"""
|
|
Test milvus-lite backend
|
|
"""
|
|
|
|
self.runTests("milvus")
|
|
self.deletenumpy("milvus")
|
|
|
|
def testMilvusCustom(self):
|
|
"""
|
|
Test milvus-lite backend with custom settings
|
|
"""
|
|
|
|
self.runTests("milvus", {"milvus": {"m": 16}})
|
|
|
|
# Test invalid file path handled
|
|
with self.assertRaises(FileNotFoundError):
|
|
ann = ANNFactory.create({"backend": "milvus"})
|
|
ann.load("non-exist-path")
|