Closed paniabhisek closed 2 months ago
hey, so this issue was fixed between v0.1.1 and v0.2.0 (also works on previous version but models are not trained optimally for it).
Essentially, you want to use our fixed base model vidore/colpaligemma-3b-pt-448-base
and make sure to also add .eval() after loading the adapter. Your best bet is to use the v1.2 model (but this will also be deterministic with the original colpali).
model_name = "vidore/colpali-v1.2"
model = ColPali.from_pretrained("vidore/colpaligemma-3b-pt-448-base", torch_dtype=torch.bfloat16, device_map="cuda").eval()
model.load_adapter(model_name)
model = model.eval()
processor = AutoProcessor.from_pretrained(model_name)
Everytime I load the model, the embedding of an image changes. Can you explain why?
Code used to get the embedding
If I use the same loaded model, the embedding is same. But if I unload and load again, it changes.
How can I make it deterministic so I can get the embedding same everytime?