Update README.md
Browse files
README.md
CHANGED
@@ -54,11 +54,9 @@ from PIL import Image
|
|
54 |
import numpy as np
|
55 |
|
56 |
model_args = ModelArguments(
|
57 |
-
model_name='
|
58 |
pooling='last',
|
59 |
-
normalize=True
|
60 |
-
lora=True,
|
61 |
-
checkpoint_path='TIGER-Lab/VLM2Vec-LoRA')
|
62 |
|
63 |
model = MMEBModel.load(model_args)
|
64 |
model.eval()
|
@@ -100,6 +98,17 @@ inputs = {key: value.to('cuda') for key, value in inputs.items()}
|
|
100 |
tgt_output = model(tgt=inputs)["tgt_reps"]
|
101 |
print(string, '=', model.compute_similarity(qry_output, tgt_output))
|
102 |
## <|image_1|> Represent the given image. = tensor([[0.3105]], device='cuda:0', dtype=torch.bfloat16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
```
|
104 |
|
105 |
## Citation
|
|
|
54 |
import numpy as np
|
55 |
|
56 |
model_args = ModelArguments(
|
57 |
+
model_name='TIGER-Lab/VLM2Vec-Full',
|
58 |
pooling='last',
|
59 |
+
normalize=True)
|
|
|
|
|
60 |
|
61 |
model = MMEBModel.load(model_args)
|
62 |
model.eval()
|
|
|
98 |
tgt_output = model(tgt=inputs)["tgt_reps"]
|
99 |
print(string, '=', model.compute_similarity(qry_output, tgt_output))
|
100 |
## <|image_1|> Represent the given image. = tensor([[0.3105]], device='cuda:0', dtype=torch.bfloat16)
|
101 |
+
|
102 |
+
inputs = processor('Find me an everyday image that matches the given caption: A cat and a tiger.',)
|
103 |
+
inputs = {key: value.to('cuda') for key, value in inputs.items()}
|
104 |
+
qry_output = model(qry=inputs)["qry_reps"]
|
105 |
+
|
106 |
+
string = '<|image_1|> Represent the given image.'
|
107 |
+
inputs = processor(string, [Image.open('figures/example.jpg')])
|
108 |
+
inputs = {key: value.to('cuda') for key, value in inputs.items()}
|
109 |
+
tgt_output = model(tgt=inputs)["tgt_reps"]
|
110 |
+
print(string, '=', model.compute_similarity(qry_output, tgt_output))
|
111 |
+
## <|image_1|> Represent the given image. = tensor([[0.2158]], device='cuda:0', dtype=torch.bfloat16)
|
112 |
```
|
113 |
|
114 |
## Citation
|