Update use_model.py
Browse files- use_model.py +2 -3
use_model.py
CHANGED
@@ -8,11 +8,10 @@ from tokenization import WoBertTokenizer
|
|
8 |
from transformers.models.bert import BertModel, BertConfig
|
9 |
|
10 |
input_sentent = '欢迎使用阿里灵界比赛预训练模型'
|
11 |
-
tokenizer = WoBertTokenizer.from_pretrained('
|
12 |
input_ids = tokenizer.encode(input_sentent, return_tensors='pt')
|
13 |
|
14 |
-
|
15 |
-
model = BertModel.from_pretrained('./wobert_repretrain/pytorch_model.bin', config=config)
|
16 |
|
17 |
output = model(input_ids)
|
18 |
print(output[0].size()) # torch.Size([1, 11, 768])
|
|
|
8 |
from transformers.models.bert import BertModel, BertConfig
|
9 |
|
10 |
input_sentent = '欢迎使用阿里灵界比赛预训练模型'
|
11 |
+
tokenizer = WoBertTokenizer.from_pretrained('luxiao/alilingjie')
|
12 |
input_ids = tokenizer.encode(input_sentent, return_tensors='pt')
|
13 |
|
14 |
+
model = BertModel.from_pretrained('luxiao/alilingjie')
|
|
|
15 |
|
16 |
output = model(input_ids)
|
17 |
print(output[0].size()) # torch.Size([1, 11, 768])
|