Convert Pytorch Model to Huggingface Transformer?

Hi, is it at all possible (and if so, how) to convert a custom and already-trained PyTorch model to a huggingface transformer model?
My main goal is to get a config.json file from all of this and I cannot refactor the model code, as I cannot train the model from scratch. (As suggested in this post How to create a config.json after saving a model )

3 Likes

Hey there! You might want to take a look at the following guide, which shows how to share custom configurations, custom models, and share the custom code for others to use.

1 Like

Very shitty documentation to understand, especially for beginners.