Chinese Ancient GPT2 Model
Model description
The model is used to generate ancient Chinese.The model uses the frame of GPT2-medium. We trained on 4 P100 for about 8 days.(batch size = 4, steps = 1M)
How to use
You can use the model directly with a pipeline for text generation:
from transformers import BertTokenizer, GPT2LMHeadModel, TextGenerationPipeline
tokenizer = BertTokenizer.from_pretrained("zhuimengshaonian/gpt2-ancient-medium")
model = GPT2LMHeadModel.from_pretrained("zhuimengshaonian/gpt2-ancient-medum")
text_generator = TextGenerationPipeline(model, tokenizer)
text_generator("[CLS]当是时", max_length=100, do_sample=True)