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