Update README.md
Browse files
README.md
CHANGED
@@ -77,7 +77,8 @@ with torch.no_grad():
|
|
77 |
image_feature = image_feature / image_feature.norm(p=2, dim=-1, keepdim=True)
|
78 |
text_feature = text_feature / text_feature.norm(p=2, dim=-1, keepdim=True)
|
79 |
|
80 |
-
logits_per_image = image_feature @ text_feature.T
|
|
|
81 |
probs = logits_per_image.softmax(dim=1)
|
82 |
print(probs)
|
83 |
|
|
|
77 |
image_feature = image_feature / image_feature.norm(p=2, dim=-1, keepdim=True)
|
78 |
text_feature = text_feature / text_feature.norm(p=2, dim=-1, keepdim=True)
|
79 |
|
80 |
+
logits_per_image = image_feature @ text_feature.T
|
81 |
+
logits_per_image = model.logit_scale.exp() * logits_per_image
|
82 |
probs = logits_per_image.softmax(dim=1)
|
83 |
print(probs)
|
84 |
|