File size: 581 Bytes
431fc47
ce0f79a
431fc47
 
ce0f79a
431fc47
c359b90
 
ce0f79a
e9be75f
431fc47
c359b90
 
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python
from transformers import AutoTokenizer, TFAutoModelForCausalLM, AutoModelForCausalLM, GPT2Config
import tensorflow as tf

config = GPT2Config.from_pretrained("Sentdex/GPyT")
tokenizer = AutoTokenizer.from_pretrained("Sentdex/GPyT")
tf_model =  TFAutoModelForCausalLM.from_pretrained("Sentdex/GPyT")
pytorch_model = AutoModelForCausalLM.from_pretrained("Sentdex/GPyT")

config.save_pretrained('./')
tokenizer.save_pretrained(save_directory='./')
tf_model.save_pretrained(save_directory='./', saved_model=True)
pytorch_model.save_pretrained(save_directory='./')