stanford-futuredata / ColBERT

ColBERT: state-of-the-art neural search (SIGIR'20, TACL'21, NeurIPS'21, NAACL'22, CIKM'22, ACL'23, EMNLP'23)
MIT License
2.67k stars 355 forks source link

Fine tuning using colbert-ir/colbertv2.0 using training script now gives error #291

Open DeepaliP98 opened 5 months ago

DeepaliP98 commented 5 months ago

Failure at: ColBERT/colbert/modeling/colbert.py", line 173, in colbert_score assert Q.size(0) in [1, D_padded.size(0)]

I see that colbert_config.nway = 64 Q.size(0) = batch_sizecolbert_config.nway = 3264 D_padded.size(0) = 64 = bsize in indexer.py

Am I setting up something incorrectly?

1mono2 commented 5 months ago

@DeepaliP98 My environment: sagemaker jupyter notebook sagemaker jupyter notebook (amazon machine learning environment) GPU: Tesla T4 Cuda: 11.8

I also encountered the same error. Restarting the runtime kernel solved the problem. I don't understand why, but I assume that the ColBERTConfig settings need to be initialized.

I am not sure, but I suspect that Q.size(0) represents the number of tokens in the Query and D_padded.size(0) represents the number of tokens in the document

okhat commented 5 months ago

Ahh this is probably related to a recent improvement by @bclavie but it ends up loading a lot more config than he intended, since config is currently all or none

okhat commented 5 months ago

The temporary fix for @DeepaliP98 and @1mono2 is to manually set nway to 2 in your script (in the config)

bclavie commented 5 months ago

Oh yes this is definitely what’s going on…

What do you think should be the best behaviour here @okhat ? Breaking compatibility like this is a very unpleasant side effect of loading the full config… Maybe we should load it then reset the breaking arguments (just nway?) to default values?

hiepxanh commented 5 months ago

@okhat what do you thing? a fallback default values should be fine, with a warning log or something?

ttkhang2 commented 1 month ago

@DeepaliP98 can i get your email to contact? I have some problems in finetuning colbert and i think i need your help!