未验证 提交 5cb47352 编写于 作者: P pkpk 提交者: GitHub

Fix bug dybert (#4271)

* Update README.md (#4267)

* test=develop
上级 6107a608
......@@ -16,7 +16,7 @@
| Model | Layers | Hidden size | Heads |Parameters |
| :------| :------: | :------: |:------: |:------: |
| [BERT-Base, Uncased](https://baidu-nlp.bj.bcebos.com/DYGRAPH_models%2FBERT%2Fdata.tar.gz) | 12 | 768 |12 |110M |
| [BERT-Base, Uncased](https://baidu-nlp.bj.bcebos.com/DYGRAPH_models/BERT/data.tar.gz) | 12 | 768 |12 |110M |
每个压缩包都包含了模型配置文件 `bert_config.json`、参数文件夹 `params`、动态图参数文件夹`dygraph_params` 和词汇表 `vocab.txt`
......
......@@ -4,7 +4,7 @@ BERT_BASE_PATH="./data/pretrained_models/uncased_L-12_H-768_A-12/"
TASK_NAME='MNLI'
DATA_PATH="./data/glue_data/MNLI/"
CKPT_PATH="./data/saved_model/mnli_models"
GPU_TO_USE="0,1,2,3"
GPU_TO_USE=0,1,2,3
export CUDA_VISIBLE_DEVICES=$GPU_TO_USE
......
......@@ -83,7 +83,13 @@ def init_pretraining_params(exe,
def init_from_static_model(dir_path, cls_model, bert_config):
def load_numpy_weight(file_name):
if six.PY2:
res = np.load(os.path.join(dir_path, file_name), allow_pickle=True)
else:
res = np.load(
os.path.join(dir_path, file_name),
allow_pickle=True,
encoding='latin1')
assert res is not None
return res
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册