1111CANONICAL_IMAGE_VALUES = {
1212 "Qdrant/colpali-v1.3-fp16" : np .array (
1313 [
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 ],
2321 ]
2422 ),
2523}
@@ -56,8 +54,8 @@ def test_batch_embedding():
5654 result = list (model .embed_image (images , batch_size = 2 ))
5755
5856 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 )
6159
6260
6361def test_single_embedding ():
@@ -67,7 +65,7 @@ def test_single_embedding():
6765 print ("evaluating" , model_name )
6866 model = LateInteractionMultimodalEmbedding (model_name = model_name )
6967 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
7169 assert np .allclose (result [:token_num , :abridged_dim ], expected_result , atol = 2e-3 )
7270
7371
0 commit comments