Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sonam-pankaj95 authored Apr 15, 2024
1 parent 68719ba commit 168fddc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,17 @@ embeddings = np.array([data.embedding for data in data])


### To use multimodal embedding: we support CLIP
### Requirements Directory with pictures you want to search

```python
data:list[EmbedData] = embed_anything.embed_file("filename.pdf", embeder= "Clip")
data:list[EmbedData] = embed_anything.embed_directory("test_files", embeder= "Clip")
embeddings = np.array([data.embedding for data in data])

query = "photo of a dog"
query_embedding = np.array(embed_anything.embed_query(query, embeder= "Clip")[0].embedding)
similarities = np.dot(embeddings, query_embedding)
max_index = np.argmax(similarities)
Image.open(data[max_index].text).show()
```


Expand Down

0 comments on commit 168fddc

Please sign in to comment.