

# Chinese GPT2 Model

## Model description

The model is used to generate Chinese texts. 
## 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("uer/gpt2-chinese-cluecorpussmall")
>>> model = GPT2LMHeadModel.from_pretrained("uer/gpt2-chinese-cluecorpussmall")
>>> text_generator = TextGenerationPipeline(model, tokenizer)   
>>> text_generator("这是很久之前的事情了", max_length=100, do_sample=True)
    [{'generated_text': '这是很久之前的事情了 。 至 今 仍 留 在 我 身 上 ， 我 记 忆 犹 新 。 在 接 受 记 者 采 访 时 ， 杨 杰 表 白 了 ， 当 初 有 没 有 见 过 我 ， 我 不 认 为 他 们 是 不 合 适 的 人 。 虽 然 当 时 他 们 不 信 我 ， 但 杨 杰 表 示 ， 感 觉 那 个 时 候 感 觉 是 好 想 听 他 们 说 话 ，'}]

```

## Training data

[CLUECorpusSmall](https://github.com/CLUEbenchmark/CLUECorpus2020/) is used as training data.
{"language": "zh", "license": "apache-2.0", "datasets": ["clue"], "widget": [{"text": "\u8fd9\u662f\u5f88\u4e45\u4e4b\u524d\u7684\u4e8b\u60c5\u4e86"}], "pipeline_tag": "text-generation"}
transformers pytorch safetensors gpt2 text-generation zh dataset:clue license:apache-2.0 autotrain_compatible endpoints_compatible text-generation-inference region:us
TAGS
#transformers #pytorch #safetensors #gpt2 #text-generation #zh #dataset-clue #license-apache-2.0 #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 



# Chinese GPT2 Model

## Model description

The model is used to generate Chinese texts. 
## How to use

You can use the model directly with a pipeline for text generation:



## Training data

CLUECorpusSmall is used as training data.
# Chinese GPT2 Model ## Model description

The model is used to generate Chinese texts. ## How to use

You can use the model directly with a pipeline for text generation: ## Training data

CLUECorpusSmall is used as training data.
TAGS
#transformers #pytorch #safetensors #gpt2 #text-generation #zh #dataset-clue #license-apache-2.0 #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
 # Chinese GPT2 Model ## Model description

The model is used to generate Chinese texts. ## How to use

You can use the model directly with a pipeline for text generation: ## Training data

CLUECorpusSmall is used as training data.
TAGS
#transformers #pytorch #safetensors #gpt2 #text-generation #zh #dataset-clue #license-apache-2.0 #autotrain_compatible #endpoints_compatible #text-generation-inference #region-us 
# Chinese GPT2 Model## Model description

The model is used to generate Chinese texts.## How to use

You can use the model directly with a pipeline for text generation:## Training data

CLUECorpusSmall is used as training data.