Loaded models lost their predictive power
Lately , every time i load a model it seems to have lost all it has learned. I checked if the state dict are identical after and before and yes they areMoreover i have already use this code before and didn’t experience any problem. It’s the first time i encountering itCode to save:def on_train_end(self, trainer, pl_module):
        print(f"Pushing model to the hub after training")
        pl_module.processor.push_to_hub("Edgar404/donut-shivi-cheques_320",
                                    commit_message=f"Training done")
        pl_module.model.push_to_hub("Edgar404/donut-shivi-cheques_320",
                                    commit_message=f"Training done")code to load :from transformers import DonutProcessor, VisionEncoderDecoderModel

processor = DonutProcessor.from_pretrained("Edgar404/donut-shivi-cheques_320")
model = VisionEncoderDecoderModel.from_pretrained("Edgar404/donut-shivi-cheques_320")
model = model.to(device)
2024-07-05T06:50:56Z
Hey@Edgar404, did you manage to figure out why this is happening?I’m encountering the same issue with Donut as well. The code worked for me before earlier this year and now it doesn’t work.
2024-07-05T07:09:35Z
Yeah I didIt seems to be a problem related to model trained with transformers 4.41  and beyond.I reverted back to 4.40 for training and it solved the problem for me
2024-07-05T07:27:08Z
Ok nice, I’ll try that. Thanks!