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 are
Moreover i have already use this code before and didn’t experience any problem. It’s the first time i encountering it
Code 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)