You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Creating Embdeddings of the sentences and storing it into Graph DBfromlangchain_community.embeddingsimportHuggingFaceBgeEmbeddingsmodel_name="BAAI/bge-base-en-v1.5"model_kwargs= {"device": "cpu"}
encode_kwargs= {"normalize_embeddings": True}
embeddings=HuggingFaceBgeEmbeddings(
model_name=model_name, model_kwargs=model_kwargs, encode_kwargs=encode_kwargs
)
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
[<ipython-input-26-b09e1b2ff4ef>](https://localhost:8080/#) in <cell line: 2>()1# Instantiate Neo4j vector from documents---->2neo4j_vector=Neo4jVector.from_documents(
3documents,
4HuggingFaceBgeEmbeddings(),
5url=os.environ["NEO4J_URI"],
2frames
[/usr/local/lib/python3.10/dist-packages/langchain_community/vectorstores/neo4j_vector.py](https://localhost:8080/#) in __from(cls, texts, embeddings, embedding, metadatas, ids, create_id_index, search_type, **kwargs)445# If the index already exists, check if embedding dimensions match446elifnotstore.embedding_dimension==embedding_dimension:
-->447raiseValueError(
448f"Index with name {store.index_name} already exists."449"The provided embedding function and vector index "ValueError: Indexwithnamevectoralreadyexists.Theprovidedembeddingfunctionandvectorindexdimensionsdonotmatch.
Embeddingfunctiondimension: 1024Vectorindexdimension: 768
The embedding model utilized in HuggingFaceBgeEmbeddings is denoted as BAAI/bge-base-en-v1.5, possessing an embedding dimension of 768. This specification ostensibly aligns with the vector store index dimension of 768. Nevertheless, upon execution of the provided code, a dimension mismatch error is encountered despite the apparent alignment.
Example Code
Description / Actual Behaviour
The embedding model utilized in
HuggingFaceBgeEmbeddings
is denoted asBAAI/bge-base-en-v1.5
, possessing an embedding dimension of768
. This specification ostensibly aligns with the vector store index dimension of768
. Nevertheless, upon execution of the provided code, a dimension mismatch error is encountered despite the apparent alignment.System Info
Expected Behaviour
This code will run and store the embedding of the documents in neo4j vector store without raising any error.
The text was updated successfully, but these errors were encountered: