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:
>>> 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 is used as training data.
- Downloads last month
- 130
Inference Providers
NEW
This model is not currently available via any of the supported Inference Providers.