gpt-code / clone_sentdex_model_tokenizer.py
cakiki's picture
Add config
ce0f79a
raw
history blame
No virus
581 Bytes
#!/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='./')