python bert code fix

This commit is contained in:
chongjiu.jin
2019-12-24 10:26:47 +08:00
parent 8b915566c0
commit 0f83d3f3cc
5 changed files with 54 additions and 30 deletions

View File

@@ -32,7 +32,7 @@ bert_config = BertConfig.from_json_file(bert_config_file)
tokenizer = tokenization(vocab_file=vocab_file, do_lower_case=do_lower_case)
# 加载模型
model_bert = BertModel.from_pretrained(bert_path)
model_bert = BertModel.from_pretrained(bert_path,config=bert_config)
model_bert.to(device)