Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
hapi
提交
f5e4e123
H
hapi
项目概览
PaddlePaddle
/
hapi
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hapi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f5e4e123
编写于
4月 30, 2020
作者:
P
pkpk
提交者:
GitHub
4月 30, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #71 from xyzhou-puck/master
update bert-leveldb
上级
bc92efe4
4c11001a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
12 deletion
+17
-12
examples/bert/run_classifier_single_gpu.sh
examples/bert/run_classifier_single_gpu.sh
+2
-4
examples/bert_leveldb/bert_classifier.py
examples/bert_leveldb/bert_classifier.py
+1
-1
examples/bert_leveldb/readme.md
examples/bert_leveldb/readme.md
+11
-0
examples/bert_leveldb/run_classifier_multi_gpu.sh
examples/bert_leveldb/run_classifier_multi_gpu.sh
+2
-4
examples/bert_leveldb/run_classifier_single_gpu.sh
examples/bert_leveldb/run_classifier_single_gpu.sh
+1
-3
未找到文件。
examples/bert/run_classifier_single_gpu.sh
浏览文件 @
f5e4e123
#!/bin/bash
#!/bin/bash
BERT_BASE_PATH
=
"./data/pretrained_models/uncased_L-12_H-768_A-12/"
BERT_BASE_PATH
=
"./bert_uncased_L-12_H-768_A-12/"
TASK_NAME
=
'MNLI'
DATA_PATH
=
"./data/glue_data/MNLI/"
DATA_PATH
=
"./data/glue_data/MNLI/"
CKPT_PATH
=
"./data/saved_model/mnli_models"
CKPT_PATH
=
"./data/saved_model/mnli_models"
export
CUDA_VISIBLE_DEVICES
=
1
export
CUDA_VISIBLE_DEVICES
=
0
# start fine-tuning
# start fine-tuning
python3.7 bert_classifier.py
\
python3.7 bert_classifier.py
\
...
@@ -12,7 +11,6 @@ python3.7 bert_classifier.py\
...
@@ -12,7 +11,6 @@ python3.7 bert_classifier.py\
--do_train
true
\
--do_train
true
\
--do_test
true
\
--do_test
true
\
--batch_size
64
\
--batch_size
64
\
--init_pretraining_params
${
BERT_BASE_PATH
}
/dygraph_params/
\
--data_dir
${
DATA_PATH
}
\
--data_dir
${
DATA_PATH
}
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--checkpoints
${
CKPT_PATH
}
\
--checkpoints
${
CKPT_PATH
}
\
...
...
examples/bert_leveldb/bert_classifier.py
浏览文件 @
f5e4e123
...
@@ -159,7 +159,7 @@ def main():
...
@@ -159,7 +159,7 @@ def main():
labels
,
labels
,
device
=
device
)
device
=
device
)
cls_model
.
bert_layer
.
load
(
"./bert_
small
"
,
reset_optimizer
=
True
)
cls_model
.
bert_layer
.
load
(
"./bert_
uncased_L-12_H-768_A-12/bert
"
,
reset_optimizer
=
True
)
# do train
# do train
cls_model
.
fit
(
train_data
=
train_dataloader
.
dataloader
,
cls_model
.
fit
(
train_data
=
train_dataloader
.
dataloader
,
...
...
examples/bert_leveldb/readme.md
0 → 100644
浏览文件 @
f5e4e123
0.
python3.7 -m pip install leveldb
1.
download data: wget https://paddle-hapi.bj.bcebos.com/data/bert_data.tar.gz
2.
unzip data: tar -zvxf bert_data.tar.gz
3.
download pretrained parameters: wget https://paddle-hapi.bj.bcebos.com/models/bert_uncased_L-12_H-768_A-12.tar.gz
4.
unzip pretrained parameters: tar -zvxf bert_uncased_L-12_H-768_A-12.tar.gz
4.
bash run_classifier_single_gpu.sh
examples/bert_leveldb/run_classifier_multi_gpu.sh
浏览文件 @
f5e4e123
#!/bin/bash
#!/bin/bash
BERT_BASE_PATH
=
"./data/pretrained_models/uncased_L-12_H-768_A-12/"
BERT_BASE_PATH
=
"./bert_uncased_L-12_H-768_A-12/"
TASK_NAME
=
'MNLI'
DATA_PATH
=
"./data/glue_data/MNLI/"
DATA_PATH
=
"./data/glue_data/MNLI/"
CKPT_PATH
=
"./data/saved_model/mnli_models"
CKPT_PATH
=
"./data/saved_model/mnli_models"
# start fine-tuning
# start fine-tuning
python3.7
-m
paddle.distributed.launch
--started_port
8899
--selected_gpus
=
1,2,3 bert_classifier.py
\
python3.7
-m
paddle.distributed.launch
--started_port
8899
--selected_gpus
=
0,
1,2,3 bert_classifier.py
\
--use_cuda
true
\
--use_cuda
true
\
--do_train
true
\
--do_train
true
\
--do_test
true
\
--do_test
true
\
--batch_size
64
\
--batch_size
64
\
--init_pretraining_params
${
BERT_BASE_PATH
}
/dygraph_params/
\
--data_dir
${
DATA_PATH
}
\
--data_dir
${
DATA_PATH
}
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--checkpoints
${
CKPT_PATH
}
\
--checkpoints
${
CKPT_PATH
}
\
...
...
examples/bert_leveldb/run_classifier_single_gpu.sh
浏览文件 @
f5e4e123
#!/bin/bash
#!/bin/bash
BERT_BASE_PATH
=
"./data/pretrained_models/uncased_L-12_H-768_A-12/"
BERT_BASE_PATH
=
"./bert_uncased_L-12_H-768_A-12/"
TASK_NAME
=
'MNLI'
DATA_PATH
=
"./data/glue_data/MNLI/"
DATA_PATH
=
"./data/glue_data/MNLI/"
CKPT_PATH
=
"./data/saved_model/mnli_models"
CKPT_PATH
=
"./data/saved_model/mnli_models"
...
@@ -12,7 +11,6 @@ python3.7 bert_classifier.py\
...
@@ -12,7 +11,6 @@ python3.7 bert_classifier.py\
--do_train
true
\
--do_train
true
\
--do_test
true
\
--do_test
true
\
--batch_size
64
\
--batch_size
64
\
--init_pretraining_params
${
BERT_BASE_PATH
}
/dygraph_params/
\
--data_dir
${
DATA_PATH
}
\
--data_dir
${
DATA_PATH
}
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--vocab_path
${
BERT_BASE_PATH
}
/vocab.txt
\
--checkpoints
${
CKPT_PATH
}
\
--checkpoints
${
CKPT_PATH
}
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录