mirror of
https://github.com/neuml/txtai.git
synced 2026-10-11 21:39:55 +00:00
34 lines
679 B
Python
34 lines
679 B
Python
"""
|
|
Zvec ANN module tests
|
|
"""
|
|
|
|
from txtai.ann import ANNFactory
|
|
|
|
from .base import DenseTest
|
|
|
|
|
|
class TestZvec(DenseTest):
|
|
"""
|
|
Zvec ANN tests.
|
|
"""
|
|
|
|
def testZvec(self):
|
|
"""
|
|
Test zvec backend
|
|
"""
|
|
|
|
self.runTests("zvec")
|
|
self.deletenumpy("zvec")
|
|
|
|
def testZvecCustom(self):
|
|
"""
|
|
Test zvec backend with custom settings
|
|
"""
|
|
|
|
self.runTests("zvec", {"zvec": {"efconstruction": 100, "m": 16, "efsearch": 50}})
|
|
|
|
# Test invalid file path handled
|
|
with self.assertRaises(FileNotFoundError):
|
|
ann = ANNFactory.create({"backend": "zvec"})
|
|
ann.load("non-exist-path")
|