Possible bug in modeling_molmoe.py

#26
by EthanLeoLYX - opened

When finetuning molmoe, I encountered this problem

File "/root/.cache/huggingface/modules/transformers_modules/MolmoE/modeling_molmoe.py", line 1920, in forward
x[batch_idx[valid], image_input_idx[valid]] += image_features[valid]
RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.

Maybe this can be fixed by:

x = x.clone()
x[batch_idx[valid], image_input_idx[valid]] += image_features[valid]

Sign up or log in to comment