Skip to content

Commit ca637bf

Browse files
committed
Updated example [skip ci]
1 parent af7b04f commit ca637bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/colpali/exact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737

3838
def generate_embeddings(processed):
3939
with torch.no_grad():
40-
return model(**processed.to(model.device))
40+
return model(**processed.to(model.device)).to(torch.float32).numpy(force=True)
4141

4242

4343
def binary_quantize(embedding):
44-
return Bit(embedding.gt(0).numpy(force=True))
44+
return Bit(embedding > 0)
4545

4646

4747
input = load_dataset('vidore/docvqa_test_subsampled', split='test[:3]')['image']

0 commit comments

Comments
 (0)