Update README.md
Browse files
README.md
CHANGED
|
@@ -44,10 +44,15 @@ inputs = [
|
|
| 44 |
"prompt": f"{image_placeholder}\nA woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.",
|
| 45 |
"multi_modal_data": {"image": image},
|
| 46 |
},
|
| 47 |
-
]
|
| 48 |
|
| 49 |
outputs = model.embed(inputs)
|
| 50 |
embeddings = torch.tensor([o.outputs.embedding for o in outputs])
|
| 51 |
scores = embeddings[:2] @ embeddings[2:].T
|
| 52 |
print(scores.tolist())
|
| 53 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
"prompt": f"{image_placeholder}\nA woman shares a joyful moment with her golden retriever on a sun-drenched beach at sunset, as the dog offers its paw in a heartwarming display of companionship and trust.",
|
| 45 |
"multi_modal_data": {"image": image},
|
| 46 |
},
|
| 47 |
+
]
|
| 48 |
|
| 49 |
outputs = model.embed(inputs)
|
| 50 |
embeddings = torch.tensor([o.outputs.embedding for o in outputs])
|
| 51 |
scores = embeddings[:2] @ embeddings[2:].T
|
| 52 |
print(scores.tolist())
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
It is faster by at least 50%, by all meanings.
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+

|