Update main.py
Browse files
main.py
CHANGED
@@ -198,7 +198,7 @@ def model_init():
|
|
198 |
tokenizer = BertTokenizerFast(vocab_file='/home/user/app/./bert-base-zh/vocab.txt', sep_token="[SEP]", pad_token="[PAD]", cls_token="[CLS]")
|
199 |
# # tokenizer = BertTokenizer(vocab_file=args.voca_path)
|
200 |
model = Word_BERT()
|
201 |
-
model.load_state_dict(torch.load('/home/user/app/./model.pth'),map_location='cpu')
|
202 |
# model = model.to(device)
|
203 |
model.eval()
|
204 |
return tokenizer,model
|
|
|
198 |
tokenizer = BertTokenizerFast(vocab_file='/home/user/app/./bert-base-zh/vocab.txt', sep_token="[SEP]", pad_token="[PAD]", cls_token="[CLS]")
|
199 |
# # tokenizer = BertTokenizer(vocab_file=args.voca_path)
|
200 |
model = Word_BERT()
|
201 |
+
model.load_state_dict(torch.load('/home/user/app/./model.pth'),map_location=torch.device('cpu'))
|
202 |
# model = model.to(device)
|
203 |
model.eval()
|
204 |
return tokenizer,model
|