-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from databio/dev
Release v0.9.0
- Loading branch information
Showing
34 changed files
with
1,387 additions
and
398 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.8.0" | ||
__version__ = "0.9.0" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import bbconf | ||
|
||
bba = bbconf.BedBaseAgent("deployment/config/api-dev.bedbase.org.yaml") | ||
|
||
bba.config._b2bsi = bba.config._init_b2bsi_object() | ||
bba.config._r2v = bba.config._init_r2v_object() | ||
bba.config._bivec = bba.config._init_bivec_object() | ||
|
||
|
||
# Here's some code to test the BiVectorSearchInterface | ||
|
||
from geniml.search.interfaces import BiVectorSearchInterface | ||
from geniml.search.backends import BiVectorBackend | ||
|
||
from geniml.search.query2vec import Text2Vec | ||
|
||
search_backend = BiVectorBackend( | ||
metadata_backend=self._qdrant_text_engine, bed_backend=self._qdrant_engine | ||
) | ||
|
||
t2v = Text2Vec("sentence-transformers/all-MiniLM-L6-v2", v2v=None) | ||
|
||
bvsi = BiVectorSearchInterface() | ||
|
||
from langchain_huggingface.embeddings import HuggingFaceEmbeddings | ||
import logging | ||
from typing import Union | ||
|
||
import numpy as np | ||
from langchain_huggingface.embeddings import HuggingFaceEmbeddings | ||
|
||
from geniml.text2bednn import Vec2VecFNN | ||
from geniml.search.query2vec.abstract import Query2Vec | ||
|
||
# culprit: | ||
te = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2") | ||
|
||
# Testing the sentence transformers: | ||
|
||
|
||
from sentence_transformers import SentenceTransformer | ||
|
||
sentences = ["This is an example sentence", "Each sentence is converted"] | ||
|
||
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") | ||
embeddings = model.encode(sentences) | ||
print(embeddings) | ||
|
||
|
||
from fastembed import TextEmbedding | ||
|
||
model = TextEmbedding( | ||
model_name="sentence-transformers/all-MiniLM-L6-v2", max_length=512 | ||
) | ||
sentences = ["This is an example sentence", "Each sentence is converted"] | ||
embeddings = list(model.embed(sentences)) |
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.