qingshan777 commited on
Commit
667d62b
·
verified ·
1 Parent(s): 6ca42c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -1
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