Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PALM
提交
cb213b02
P
PALM
项目概览
PaddlePaddle
/
PALM
通知
5
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PALM
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cb213b02
编写于
12月 05, 2019
作者:
X
xixiaoyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add download, convert and recover script
上级
ca5921da
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
113 addition
and
0 deletion
+113
-0
script/convert_params.sh
script/convert_params.sh
+37
-0
script/download_pretrain_backbone.sh
script/download_pretrain_backbone.sh
+43
-0
script/recover_params.sh
script/recover_params.sh
+33
-0
未找到文件。
script/convert_params.sh
0 → 100755
浏览文件 @
cb213b02
#!/bin/sh
if
[[
$#
!=
1
]]
;
then
echo
"usage: bash convert_params.sh <params_dir>"
exit
1
fi
if
[[
-f
$1
/__palminfo__
]]
;
then
echo
"already converted."
exit
0
fi
echo
"converting..."
if
[[
-d
$1
/params
]]
;
then
cd
$1
/params
else
cd
$1
fi
mkdir
.palm.backup
for
file
in
$(
ls
*
)
do
cp
$file
.palm.backup
;
mv
$file
"__paddlepalm_"
$file
done
tar
-cf
__rawmodel__ .palm.backup/
*
rm
.palm.backup/
*
mv
__rawmodel__ .palm.backup
# find . ! -name '__rawmodel__' -exec rm {} +
tar
-cf
__palmmodel__ __paddlepalm_
*
touch
__palminfo__
ls
__paddlepalm_
*
>
__palminfo__
rm
__paddlepalm_
*
cd
-
>
/dev/null
echo
"done!"
script/download_pretrain_backbone.sh
0 → 100755
浏览文件 @
cb213b02
#!/bin/bash
set
-e
if
[[
$#
!=
1
]]
;
then
echo
"Usage: bash download_pretrain.sh <bert|ernie>"
exit
1
fi
if
[[
$1
==
'bert'
]]
;
then
name
=
"bert"
link
=
"https://bert-models.bj.bcebos.com/uncased_L-24_H-1024_A-16.tar.gz"
packname
=
"uncased_L-24_H-1024_A-16.tar.gz"
dirname
=
"uncased_L-24_H-1024_A-16"
elif
[[
$1
==
'ernie'
]]
;
then
name
=
"ernie"
link
=
"https://ernie.bj.bcebos.com/ERNIE_Large_en_stable-2.0.0.tar.gz"
packname
=
"ERNIE_Large_en_stable-2.0.0.tar.gz"
else
echo
"
$1
is currently not supported."
exit
1
fi
if
[[
!
-d
pretrain_model
]]
;
then
mkdir
pretrain_model
fi
cd
pretrain_model
mkdir
$name
cd
$name
echo
"downloading
${
name
}
..."
wget
--no-check-certificate
$link
echo
"decompressing..."
tar
-zxf
$packname
rm
-rf
$packname
if
[[
$dirname
!=
""
]]
;
then
mv
$dirname
/
*
.
rm
-rf
$dirname
fi
cd
../..
script/recover_params.sh
0 → 100755
浏览文件 @
cb213b02
#!/bin/sh
if
[[
$#
!=
1
]]
;
then
echo
"usage: bash recover_params.sh <params_dir>"
exit
1
fi
if
[[
!
-d
$1
]]
;
then
echo
"
$1
not found."
exit
1
fi
if
[[
!
-f
$1
/__palmmodel__
]]
;
then
echo
"paddlepalm model not found."
exit
1
fi
echo
"recovering..."
if
[[
-d
$1
/params
]]
;
then
cd
$1
/params
else
cd
$1
fi
rm
__palm
*
mv
.palm.backup/__rawmodel__
.
rm
-rf
.palm.backup
tar
-xf
__rawmodel__
mv
.palm.backup/
*
.
rm
__rawmodel__
rm
-rf
.palm.backup
cd
-
>
/dev/null
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录