[Model Exporting] How to export a fine tuned model to a single pytorch or tensorflow model file?
Apologies if this is a very basic question, but I just cant seem to find any help or documentation for this online.

I want to use google cloud to generate text from a trained model and the maximum size for a model there is ``500MB``. Currently when finetuning a model the checkpoints folder has the ``model.bin`` file and an ``optimizer.pt`` file. These both are used when loading from pretrained.

Even when using ``distilgpt2`` the combined size of this folder is ~900MB. How do I export this model to its actual documented size of ~400MB. I assume the ``optimizer.pt`` are the weights.

So please can someone help, how do I export a checkpoint to either a tensorflow model to a pytorch model so that I can then use to generate text?

I know the latest release 4.2.0 has the function ``model.save_pretrained()``, but I am using ``transformers==2.8.0`` can a model fine tuned using ``2.8.0`` be exported using the new function?

Thanks
_Note:_ that'd be a better question for the forums at discuss.huggingface.co

The `optimizer.pt` is a snapshot of the optimizer's internal state, for inference you can delete it and only keep your `model.bin` (= the weights)<|||||>Thank you, that is very helpful and for directing me to the forums, I did not even know it existed :)

As regards to my other question, is it possible to do the fine tuning in tensorflow? or even export to a tensorflow model? 

 or would this discussion be better suited to the forum?

Thanks