How to get config.json from .pt loaded model?

Hi, i have a .pt model loaded, and i would like now to upload It to hugging face-hub. But according to this tutorial Model sharing and uploading — transformers 3.2.0 documentation i need:

  • a config.json file, a pytorch_model.bin file, a special_tokens_map.json, etc…

How can i get these files from my .pt saved model?

Thanks in advanced.

Hello, can you save and push your model and tokenizer with model.save_pretrained(directory) and tokenizer.save_pretrained()? The files should be in the specified directory.

1 Like