moondream icon indicating copy to clipboard operation
moondream copied to clipboard

Fine tuning with regression head

Open 7AtAri opened this issue 1 year ago • 1 comments

I adapted your fine tuning notebook to a regression task. Unfortunately the model gets unstable during training and only returns NANs as hidden states to my regression head.

Also I wanted to try qlora, but could not use the peft library because the model does not support gradient checkpointing.

so finetuning currently seems to be possible only for some tasks…could it be possible to use peft for moondream in the future?

7AtAri avatar Oct 16 '24 13:10 7AtAri

PEFT is possible -- we use it internally and I know of other folks who have had success too. I have not tried qlora though. I would recommend looking into learning rate/other hyperparmeters if you're getting NaNs as hidden states, also make sure you're training in bfloat16 not float16 (unless you're taking other measures to ensure training stability in float16).

vikhyat avatar Nov 03 '24 09:11 vikhyat