Getting nan while fine tuning Blip 2 and weired output

I am using this code to fine-tuning model but get nan loss value and the model give strange output.
My Fine-tuning code.