mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 11:39:18 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user