#!/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='./')