A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python.langchain.com/docs/integrations/text_embedding/bge_huggingface below:

Website Navigation


BGE on Hugging Face | 🦜️🔗 LangChain

BGE on Hugging Face

BGE models on the HuggingFace are one of the best open-source embedding models. BGE model is created by the Beijing Academy of Artificial Intelligence (BAAI). BAAI is a private non-profit organization engaged in AI research and development.

This notebook shows how to use BGE Embeddings through Hugging Face

%pip install --upgrade --quiet  sentence_transformers
from langchain_community.embeddings import HuggingFaceBgeEmbeddings

model_name = "BAAI/bge-small-en"
model_kwargs = {"device": "cpu"}
encode_kwargs = {"normalize_embeddings": True}
hf = HuggingFaceBgeEmbeddings(
model_name=model_name, model_kwargs=model_kwargs, encode_kwargs=encode_kwargs
)

Note that you need to pass query_instruction="" for model_name="BAAI/bge-m3" see FAQ BGE M3.

embedding = hf.embed_query("hi this is harrison")
len(embedding)
Related

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4