swe-gpt-wiki / save_model.py
birgermoell's picture
Saving weights and logs of step 7000
49a91ba
raw history blame
No virus
306 Bytes
from transformers.modeling_flax_pytorch_utils import load_flax_checkpoint_in_pytorch_model
from transformers import GPT2_Config, GPT2_Model
config = GPT2_Config.from_pretrained("./")
model = GPT2_Model(config)
load_flax_checkpoint_in_pytorch_model(model, "./flax_model.msgpack")
model.save_pretrained("./")