How to dump huggingface models in pickl file and use it?

Is there a particular reason for why the model needs to be shared as a pickle fie? Transformers has a save_pretrained method that you can use to save a model locally, but it’ll save it as a .bin along with the model’s config. Maybe this helps a bit? How to save my model to use it later

I guess you could pickle the state_dict of a model and then reload it manually, but I’m not sure I see the utility in that. Can you share a bit more about what you’re trying to achieve, and whether having a pickle file is a hard requirement?

1 Like