Skip to content

Commit

Permalink
Add comment for Cosine Similarity
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Chang <[email protected]>
  • Loading branch information
mocsharp committed Oct 21, 2024
1 parent 9e54574 commit 8e58e91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions applications/nvidia_nim/nvidia_nim_nvclip/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def compute(self, op_input, op_output, context):
message = input[0].copy()
message.append(input[1])

# Reference: Cosine Similarity https://docs.nvidia.com/nim/nvclip/latest/getting-started.html#cosine-similarity
# Calculate cosine similarity between images and text
try:
embeddings_data = self.client.embeddings.create(
input=message, model=self.model, encoding_format=self.encoding_format
Expand Down

0 comments on commit 8e58e91

Please sign in to comment.