11
11
CANONICAL_IMAGE_VALUES = {
12
12
"Qdrant/colpali-v1.3-fp16" : np .array (
13
13
[
14
- [
15
- [- 0.0345 , - 0.022 , 0.0567 , - 0.0518 , - 0.0782 , 0.1714 , - 0.1738 ],
16
- [- 0.1181 , - 0.099 , 0.0268 , 0.0774 , 0.0228 , 0.0563 , - 0.1021 ],
17
- [- 0.117 , - 0.0683 , 0.0371 , 0.0921 , 0.0107 , 0.0659 , - 0.0666 ],
18
- [- 0.1393 , - 0.0948 , 0.037 , 0.0951 , - 0.0126 , 0.0678 , - 0.087 ],
19
- [- 0.0957 , - 0.081 , 0.0404 , 0.052 , 0.0409 , 0.0335 , - 0.064 ],
20
- [- 0.0626 , - 0.0445 , 0.056 , 0.0592 , - 0.0229 , 0.0409 , - 0.0301 ],
21
- [- 0.1299 , - 0.0691 , 0.1097 , 0.0728 , 0.0123 , 0.0519 , 0.0122 ],
22
- ]
14
+ [- 0.0345 , - 0.022 , 0.0567 , - 0.0518 , - 0.0782 , 0.1714 , - 0.1738 ],
15
+ [- 0.1181 , - 0.099 , 0.0268 , 0.0774 , 0.0228 , 0.0563 , - 0.1021 ],
16
+ [- 0.117 , - 0.0683 , 0.0371 , 0.0921 , 0.0107 , 0.0659 , - 0.0666 ],
17
+ [- 0.1393 , - 0.0948 , 0.037 , 0.0951 , - 0.0126 , 0.0678 , - 0.087 ],
18
+ [- 0.0957 , - 0.081 , 0.0404 , 0.052 , 0.0409 , 0.0335 , - 0.064 ],
19
+ [- 0.0626 , - 0.0445 , 0.056 , 0.0592 , - 0.0229 , 0.0409 , - 0.0301 ],
20
+ [- 0.1299 , - 0.0691 , 0.1097 , 0.0728 , 0.0123 , 0.0519 , 0.0122 ],
23
21
]
24
22
),
25
23
}
@@ -56,8 +54,8 @@ def test_batch_embedding():
56
54
result = list (model .embed_image (images , batch_size = 2 ))
57
55
58
56
for value in result :
59
- batch_size , token_num , abridged_dim = expected_result .shape
60
- assert np .allclose (value [:token_num , :abridged_dim ], expected_result , atol = 1e -3 )
57
+ token_num , abridged_dim = expected_result .shape
58
+ assert np .allclose (value [:token_num , :abridged_dim ], expected_result , atol = 2e -3 )
61
59
62
60
63
61
def test_single_embedding ():
@@ -67,7 +65,7 @@ def test_single_embedding():
67
65
print ("evaluating" , model_name )
68
66
model = LateInteractionMultimodalEmbedding (model_name = model_name )
69
67
result = next (iter (model .embed_image (images , batch_size = 6 )))
70
- batch_size , token_num , abridged_dim = expected_result .shape
68
+ token_num , abridged_dim = expected_result .shape
71
69
assert np .allclose (result [:token_num , :abridged_dim ], expected_result , atol = 2e-3 )
72
70
73
71
0 commit comments