Convert pickle to .pth

I have a .pkl file from a Model Zoo. Is it possible to convert it into .pth file?

One way to do it is

  1. Flatten that .pkl file
  2. Initialize a new model
  3. Reload the flatten weights
  4. Save then t .pth
    (This only works if you can initialize the model with the same shapes)

Could you point some tutorial
I have production-ready .pkl model (with GPT2) and i need fine-tune it with a new dataset, but not sure how to do that