Spaces:
Sleeping
Sleeping
import chromadb | |
from chromadb.utils import embedding_functions | |
def get_client(): | |
client = chromadb.PersistentClient(path="./chromadb_linux/") | |
MODEL_NAME: str = "mixedbread-ai/mxbai-embed-large-v1" # ~ 0.5 gb | |
COLLECTION_NAME: str = "scheme" | |
EMBEDDING_FUNC = embedding_functions.SentenceTransformerEmbeddingFunction( | |
model_name=MODEL_NAME | |
) | |
schemer = client.get_collection( | |
name=COLLECTION_NAME, | |
embedding_function=EMBEDDING_FUNC, | |
) | |
return schemer | |