junnyu commited on
Commit
5eaf1fe
1 Parent(s): 0261873

update readme

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 介绍
2
+ tf版本 https://github.com/ZhuiyiTechnology/roformer
3
+ pytorch版本 https://github.com/JunnYu/RoFormer_pytorch
4
+
5
+ ## 使用
6
+ ```python
7
+ git clone https://github.com/JunnYu/RoFormer_pytorch
8
+ cd RoFormer_pytorch
9
+ import torch
10
+ from model import RoFormerModel, RoFormerTokenizer
11
+ tokenizer = RoFormerTokenizer.from_pretrained("junnyu/roformer_chinese_base")
12
+ model = RoFormerModel.from_pretrained("junnyu/roformer_chinese_base")
13
+ inputs = tokenizer(text, return_tensors="pt")
14
+ with torch.no_grad():
15
+ outputs = model(**inputs).last_hidden_state
16
+ print(outputs.shape)
17
+ ```