Azure-Samples / Azure-Samples/vector-embeddings-demos

cosine similarity is not working

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
84
Forks
95
PR merge metrics
No merged PRs in 30d

Description

In the file similarity.ipynb the method cosine_similarity is not working and I'm getting the error:

similarity = cosine_similarity(vector1, vector2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/wriju/openai-llm-chat-march-2026/03-vector-cosine.py", line 10, in cosine_similarity
[a * b for a, b in zip(v1, v2)])
~~^~~
TypeError: can't multiply sequence by non-int of type 'tuple'

The model used to vectorize is GitHub Model "openai/text-embedding-3-small", dimension 1536

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.