|
from langchain_community.embeddings import HuggingFaceEmbeddings |
|
from utils.vector_store import get_vector_store |
|
import os |
|
|
|
|
|
EMBEDDING_CONFIGS = { |
|
"General-purpose (bge-large-en)": HuggingFaceEmbeddings( |
|
model_name="BAAI/bge-large-en", |
|
model_kwargs={"device": "cpu"}, |
|
encode_kwargs={"normalize_embeddings": True} |
|
), |
|
"Fast & lightweight (bge-small-en)": HuggingFaceEmbeddings( |
|
model_name="BAAI/bge-small-en", |
|
model_kwargs={"device": "cpu"}, |
|
encode_kwargs={"normalize_embeddings": True} |
|
), |
|
"QA optimized (e5-large-v2)": HuggingFaceEmbeddings( |
|
model_name="intfloat/e5-large-v2", |
|
model_kwargs={"device": "cpu"}, |
|
encode_kwargs={"normalize_embeddings": True} |
|
), |
|
"Instruction-tuned (instructor-large)": HuggingFaceEmbeddings( |
|
model_name="hkunlp/instructor-large", |
|
model_kwargs={"device": "cpu"}, |
|
encode_kwargs={"normalize_embeddings": True} |
|
), |
|
} |
|
|