Instructions to use junnyu/roformer_chinese_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- paddlenlp
How to use junnyu/roformer_chinese_base with paddlenlp:
from paddlenlp.transformers import AutoTokenizer, RoFormerForMaskedLM tokenizer = AutoTokenizer.from_pretrained("junnyu/roformer_chinese_base", from_hf_hub=True) model = RoFormerForMaskedLM.from_pretrained("junnyu/roformer_chinese_base", from_hf_hub=True) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,12 +11,15 @@ https://github.com/ZhuiyiTechnology/roformer
|
|
| 11 |
### pytorch版本
|
| 12 |
https://github.com/JunnYu/RoFormer_pytorch
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
## 使用
|
| 15 |
```python
|
| 16 |
-
git clone https://github.com/JunnYu/RoFormer_pytorch
|
| 17 |
-
cd RoFormer_pytorch
|
| 18 |
import torch
|
| 19 |
-
from
|
| 20 |
|
| 21 |
text = "今天[MASK]很好,我[MASK]去公园玩。"
|
| 22 |
tokenizer = RoFormerTokenizer.from_pretrained("junnyu/roformer_chinese_base")
|
|
|
|
| 11 |
### pytorch版本
|
| 12 |
https://github.com/JunnYu/RoFormer_pytorch
|
| 13 |
|
| 14 |
+
## 安装
|
| 15 |
+
```bash
|
| 16 |
+
pip install git+https://github.com/JunnYu/RoFormer_pytorch.git
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
## 使用
|
| 20 |
```python
|
|
|
|
|
|
|
| 21 |
import torch
|
| 22 |
+
from roformer import RoFormerForMaskedLM, RoFormerTokenizer
|
| 23 |
|
| 24 |
text = "今天[MASK]很好,我[MASK]去公园玩。"
|
| 25 |
tokenizer = RoFormerTokenizer.from_pretrained("junnyu/roformer_chinese_base")
|