Find answers from the community

Updated 9 months ago

Is there someway by which I can use

Is there someway by which I can use euclidean distance for similarity rather than cosine for retrieval using llamaindex?
T
W
2 comments
Which embeddings model are you using? OpenAI for example recommends using cosine similarity: https://help.openai.com/en/articles/8984345-which-distance-function-should-i-use

But there are ways to use euclidean if you want to, for example with Pinecone:

Plain Text
if "quickstart-index" not in indexes:
    # dimensions are for text-embedding-ada-002
    pinecone.create_index(
        "quickstart-index", dimension=1536, metric="euclidean", pod_type="p1"
    )

https://docs.llamaindex.ai/en/stable/examples/vector_stores/existing_data/pinecone_existing_data/?h=pinecone
Add a reply
Sign up and join the conversation on Discord