Skip to content

Commit

Permalink
remove mrc loops
Browse files Browse the repository at this point in the history
  • Loading branch information
Meiyim committed Feb 3, 2020
1 parent ec89886 commit 050327e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ BQ Corpus (Bank Question corpus) is a Chinese corpus for sentence semantic equiv

### Install PaddlePaddle

This code base has been tested with Paddle Fluid 1.6.3 with Python 2/3.5+, since Paddle 1.6.3 has changed some of APIs, using version before 1.6.3 might have bug on NER tasks.
This code base has been tested with Paddle Fluid 1.6 with Python 2/3.5+, since Paddle 1.6 has changed some of APIs, using version before 1.6 might have bug on NER tasks.

**\*Important\*** When finished installing Paddle Fluid, remember to update LD_LIBRARY_PATH about CUDA, cuDNN, NCCL2, for more information on paddlepaddle setup, you can click [here](http://en.paddlepaddle.org/documentation/docs/en/1.5/beginners_guide/index_en.html) and [here](http://en.paddlepaddle.org/documentation/docs/en/1.5/beginners_guide/install/install_Ubuntu_en.html). Also, you can read FAQ at the end of this document when you encounter errors.

Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ ERNIE Tiny轻量级模型在公开数据集的效果如下所示,任务均值

## PaddlePaddle安装

本项目依赖于 Paddle 1.6.3* 由于Paddle 1.6.3版本相比之前版本有较大API改动,使用Paddle 1.6.3以前版本运行本代码库会导致序列标注等任务报错 *,请参考[安装指南](http://www.paddlepaddle.org/#quick-start)进行安装。
本项目依赖于 Paddle 1.6,* 由于Paddle 1.6版本相比之前版本有较大API改动,使用Paddle 1.6以前版本运行本代码库会导致序列标注等任务报错 *,请参考[安装指南](http://www.paddlepaddle.org/#quick-start)进行安装。

**【重要】安装后,需要及时的将 CUDA、cuDNN、NCCL2 等动态库路径加入到环境变量 LD_LIBRARY_PATH 之中,否则训练过程中会报相关的库错误。具体的paddlepaddle配置细节请查阅[这里](http://en.paddlepaddle.org/documentation/docs/zh/1.5/beginners_guide/quick_start_cn.html)**

Expand Down
2 changes: 1 addition & 1 deletion ernie/finetune/mrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_model(args, pyreader_name, ernie_config, is_training):
pos_ids = fluid.layers.data(name='2', shape=[-1, args.max_seq_len, 1], dtype='int64')
sent_ids= fluid.layers.data(name='3', shape=[-1, args.max_seq_len, 1], dtype='int64')
task_ids= fluid.layers.data(name='4', shape=[-1, args.max_seq_len, 1], dtype='int64')
input_mask = fluid.layers.data(name='5', shape=[-1, 1], dtype='float32')
input_mask = fluid.layers.data(name='5', shape=[-1, args.max_seq_len, 1], dtype='float32')
start_positions = fluid.layers.data(name='6', shape=[-1, 1], dtype='int64')
end_positions = fluid.layers.data(name='7', shape=[-1, 1], dtype='int64')
unique_id = fluid.layers.data(name='8', shape=[-1, 1], dtype='int64')
Expand Down
7 changes: 3 additions & 4 deletions ernie/run_mrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ def main(args):
if __name__ == '__main__':
prepare_logger(log)
print_arguments(args)
while True:
scope = fluid.core.Scope()
with fluid.scope_guard(scope):
main(args)
scope = fluid.core.Scope()
with fluid.scope_guard(scope):
main(args)

0 comments on commit 050327e

Please sign in to comment.