-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rename pqlite to annlite (#151)
- Loading branch information
Showing
30 changed files
with
246 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .document import DocumentArray | ||
from .storage.annlite import StorageMixins, AnnliteConfig | ||
|
||
__all__ = ['AnnliteConfig', 'DocumentArrayAnnlite'] | ||
|
||
|
||
class DocumentArrayAnnlite(StorageMixins, DocumentArray): | ||
def __new__(cls, *args, **kwargs): | ||
return super().__new__(cls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
10 changes: 2 additions & 8 deletions
10
docarray/array/storage/pqlite/__init__.py → docarray/array/storage/annlite/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docarray/array/storage/pqlite/helper.py → docarray/array/storage/annlite/helper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Annlite | ||
|
||
One can use [Annlite](https://github.com/jina-ai/annlite) as the document store for DocumentArray. It is useful when one wants to have faster Document retrieval on embeddings, i.e. `.match()`, `.find()`. | ||
|
||
|
||
## Usage | ||
|
||
One can instantiate a DocumentArray with Annlite storage like so: | ||
|
||
```python | ||
from docarray import DocumentArray | ||
|
||
da = DocumentArray(storage='annlite', config={'n_dim': 10}) | ||
``` | ||
|
||
The usage would be the same as the ordinary DocumentArray. | ||
|
||
To access a DocumentArray formerly persisted, one can specify the `data_path` in `config`. | ||
|
||
```python | ||
from docarray import DocumentArray | ||
|
||
da = DocumentArray(storage='annlite', config={'data_path': './data', 'n_dim': 10}) | ||
|
||
da.summary() | ||
``` | ||
|
||
Note that specifying the `n_dim` is mandatory before using `Annlite` as a backend for DocumentArray. | ||
|
||
Other functions behave the same as in-memory DocumentArray. | ||
|
||
## Config | ||
|
||
The following configs can be set: | ||
|
||
| Name | Description | Default | | ||
|---------------------|---------------------------------------------------------------------------------|-----------------------------| | ||
| `n_dim` | Number of dimensions of embeddings to be stored and retrieved | **This is always required** | | ||
| `data_path` | The data folder where the data is located | **A random temp folder** | | ||
| `distance` | Distance metric to be used during search. Can be 'cosine', 'dot' or 'euclidean' | 'cosine' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
weaviate | ||
sqlite | ||
qdrant | ||
annlite | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.