File size: 353 Bytes
c539a6e
 
c581921
 
 
 
c539a6e
1
2
3
4
5
6
7
8
# This script overwrites any existing PyTorch model. Generates a new one with an LM head from the pretrained Flax model.
from transformers import RobertaForMaskedLM, AutoTokenizer
model = RobertaForMaskedLM.from_pretrained("./",from_flax=True)
tokenizer = AutoTokenizer.from_pretrained("./")
tokenizer.save_pretrained("./")
model.save_pretrained("./")