We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af7b04f commit ca637bfCopy full SHA for ca637bf
examples/colpali/exact.py
@@ -37,11 +37,11 @@
37
38
def generate_embeddings(processed):
39
with torch.no_grad():
40
- return model(**processed.to(model.device))
+ return model(**processed.to(model.device)).to(torch.float32).numpy(force=True)
41
42
43
def binary_quantize(embedding):
44
- return Bit(embedding.gt(0).numpy(force=True))
+ return Bit(embedding > 0)
45
46
47
input = load_dataset('vidore/docvqa_test_subsampled', split='test[:3]')['image']
0 commit comments