by huevosabio · 1y ago · 0 comments
Also, I've heard from others that the Qwen models are a bit too overfit to the benchmarks and that their real-life usage is not as impressive as they would appear on the benchmarks.
LangChain has the embeddings for major providers:
def build_vectorstore(docs):
"""
Create vectorstore from documents using configured embedding model.
"""
# Choose embedding model
if cfg.EMBED_MODEL.lower() == "openai":
embeddings = OpenAIEmbeddings(model="text-embedding-3-small")
elif cfg.EMBED_MODEL.lower() == "huggingface":
from langchain_community.embeddings import HuggingFaceEmbeddings
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
elif cfg.EMBED_MODEL.lower() == "nomic-embed-text":
from langchain_ollama import OllamaEmbeddings
embeddings = OllamaEmbeddings(model=cfg.EMBED_MODEL)