File size: 485 Bytes
9bcff91
 
9866627
9bcff91
 
 
2ae4f3f
9bcff91
 
 
 
 
 
0c2f70d
9bcff91
695434a
3b53c0f
 
1018474
 
 
9bcff91
1018474
9bcff91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
tags:
- text-generation
language: zh
---

## Usage

```
pip install transformers
```

```python
from transformers import CpmAntTokenizer, CpmAntForCausalLM

texts = "今天天气不错,"
model = CpmAntForCausalLM.from_pretrained("openbmb/cpm-ant-10b")
tokenizer = CpmAntTokenizer.from_pretrained("openbmb/cpm-ant-10b")
input_ids = tokenizer(texts, return_tensors="pt")
outputs = model.generate(**input_ids)
output_texts = tokenizer.batch_decode(outputs)

print(output_texts)
```