OpenPrompt icon indicating copy to clipboard operation
OpenPrompt copied to clipboard

Save and re-load a trained prompt model

Open agrimaseth opened this issue 3 years ago • 1 comments

Currently, I am saving the model using the following: torch.save(prompt_model.state_dict(), PATH)

How can we load this back to test performance on other data? Pytorch tutorial says to use the following. model = TheModelClass(*args, **kwargs) model.load_state_dict(torch.load(PATH)) model.eval()

What would TheModelClass be? An example would be really appreciated.

agrimaseth avatar Dec 08 '22 17:12 agrimaseth

@ShengdingHu could you please help with this? Using the above load command doesn't work.

agrimaseth avatar May 12 '23 05:05 agrimaseth