atlasrag-backend / backend /app /core /embeddings.py
SanskarModi's picture
added hybrid search with qdrant and bm25
9ff42b8
raw
history blame contribute delete
324 Bytes
"""Embedding model abstraction."""
from typing import List
from sentence_transformers import SentenceTransformer
_model = SentenceTransformer("all-MiniLM-L6-v2")
def embed_texts(texts: List[str]) -> List[list[float]]:
"""Embed a list of texts."""
return _model.encode(texts, normalize_embeddings=True).tolist()