Tom Aarsen
commited on
Commit
·
211fa5c
1
Parent(s):
501f1f4
Remove unneeded spaces before texts in image-text setups
Browse files
README.md
CHANGED
|
@@ -122,7 +122,7 @@ with open("cat_dog_example.jpg", "wb") as f:
|
|
| 122 |
# Image + Text -> Text
|
| 123 |
image_embeddings = model.encode([{
|
| 124 |
"image": "cat_dog_example.jpg",
|
| 125 |
-
"text": "
|
| 126 |
}])
|
| 127 |
text_embeddings = model.encode([
|
| 128 |
{"text": "A cat and a dog"},
|
|
@@ -136,7 +136,7 @@ print(similarity)
|
|
| 136 |
|
| 137 |
# Text -> Image
|
| 138 |
image_embeddings = model.encode([
|
| 139 |
-
{"image": dog_cat_image_bytes, "text": "
|
| 140 |
])
|
| 141 |
text_embeddings = model.encode([
|
| 142 |
{"text": "Find me an everyday image that matches the given caption: A cat and a dog."},
|
|
|
|
| 122 |
# Image + Text -> Text
|
| 123 |
image_embeddings = model.encode([{
|
| 124 |
"image": "cat_dog_example.jpg",
|
| 125 |
+
"text": "Represent the given image with the following question: What is in the image",
|
| 126 |
}])
|
| 127 |
text_embeddings = model.encode([
|
| 128 |
{"text": "A cat and a dog"},
|
|
|
|
| 136 |
|
| 137 |
# Text -> Image
|
| 138 |
image_embeddings = model.encode([
|
| 139 |
+
{"image": dog_cat_image_bytes, "text": "Represent the given image."},
|
| 140 |
])
|
| 141 |
text_embeddings = model.encode([
|
| 142 |
{"text": "Find me an everyday image that matches the given caption: A cat and a dog."},
|