Find answers from the community

Updated last year

```

Plain Text
similarity_top_k=1000
response_mode="no_text"
query_term = "formation"

query_engine = picone_index_llama.as_query_engine(
    retriever_mode="embedding", 
    service_context=service_context,
    verbose=True,
    similarity_top_k=similarity_top_k,
    response_mode=response_mode
)

query_engine.query(query_term)

----------------
ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'content-type': 'application/json', 'Content-Length': '103', 'date': 'Sat, 09 Sep 2023 10:45:46 GMT', 'x-envoy-upstream-service-time': '0', 'server': 'envoy', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'})
HTTP response body: {"code":3,"message":"Vector dimension 1536 does not match the dimension of the index 768","details":[]}


How to set the embedding size into my query engine?
T
i
13 comments
I think the issue might be that you created the Pinecone index with a vector dimension of 768 and now you're trying to use OpenAI embeddings (1536 dimension) with that index. You probably need to rebuild your index or use a different embeddings model
No I pinecone index is created using 768. I think is will be a parameter in query engine who set embedding dimension to 1536 as default.
I don't know where to change
You'll have to recreate the index
Or make a new one
And then just set the dimensions to 1536
I am using Huggingface sentence transformer Embedding with 768 size. Using 1536 embedding size will not broken my embeddings?
Ah so you're not intending to use OpenAI embeddings
Do you have the Huggingface model defined and are you passing that in your service context?
So how to fix this issue?
Could you maybe provide some more context about your code
Add a reply
Sign up and join the conversation on Discord