community[patch]: update the default hf bge embeddings (#22627)

**Description:** This updates the langchain_community > huggingface >
default bge embeddings ([the current default recommends this
change](https://huggingface.co/BAAI/bge-large-en))
**Issue:** None
**Dependencies:** None
**Twitter handle:** @jonzeolla

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
JonZeolla
2024-09-02 18:10:21 -04:00
committed by GitHub
parent 150251fd49
commit 78ff51ce83
19 changed files with 81 additions and 45 deletions

View File

@@ -92,9 +92,10 @@ from langchain.chains.query_constructor.schema import AttributeInfo
from self_query_qdrant.chain import create_chain
model_name = "sentence-transformers/all-mpnet-base-v2"
chain = create_chain(
llm=Cohere(),
embeddings=HuggingFaceEmbeddings(),
embeddings=HuggingFaceEmbeddings(model_name=model_name),
document_contents="Descriptions of cats, along with their names and breeds.",
metadata_field_info=[
AttributeInfo(name="name", description="Name of the cat", type="string"),
@@ -112,8 +113,9 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
from self_query_qdrant.chain import initialize
model_name = "sentence-transformers/all-mpnet-base-v2"
initialize(
embeddings=HuggingFaceEmbeddings(),
embeddings=HuggingFaceEmbeddings(model_name=model_name),
collection_name="cats",
documents=[
Document(
@@ -145,7 +147,7 @@ langchain serve
### Local Server
This will start the FastAPI app with a server running locally at
This will start the FastAPI app with a server running locally at
[http://localhost:8000](http://localhost:8000)
You can see all templates at [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)