I'm trying to load a fine-tuned T5 model that I trained myself. I have it in the correct directory, the file is a .pth
I'm basically working with the exact same code, that has always worked so far, but now I'm using another computer and getting an error.
I checked to see whether the versions of torch and transformers were the same as the one that was used when the model was saved. What else could the problem be?
Thanks so much for your help!
This is the error message:
in loadraise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None_pickle.UnpicklingError: Weights only load failed. Re-running
torch.load
withweights_only
set toFalse
will likely succeed, but it can result in arbitrary code execution.Do it only if you get the file from a trusted source. WeightsUnpickler error: Unsupported class transformers.models.t5.modeling_t5.T5ForConditionalGeneration