未验证 提交 bba10bb6 编写于 作者: X Xiaoyao Xi 提交者: GitHub

Merge pull request #37 from wangxiao1021/API

remove :gz
......@@ -114,7 +114,7 @@ def _convert(path, silent=False):
if os.path.exists(path + '/params/'):
os.rename(path + '/params/', path + '/params1/')
os.mkdir(path + '/params/')
tar_model = tarfile.open(path + '/params/' + '__palmmodel__', 'w:gz')
tar_model = tarfile.open(path + '/params/' + '__palmmodel__', 'w')
tar_info = open(path + '/params/'+ '__palminfo__', 'w')
for root, dirs, files in os.walk(path + '/params1/'):
for file in files:
......
......@@ -55,7 +55,7 @@ def init_pretraining_params(exe,
print("Loading pretraining parameters from {}...".format(
pretraining_params_path))
with tarfile.open(os.path.join(pretraining_params_path, '__palmmodel__'), 'r:gz') as f:
with tarfile.open(os.path.join(pretraining_params_path, '__palmmodel__'), 'r') as f:
f.extractall(os.path.join(pretraining_params_path, '.temp'))
log_path = os.path.join(pretraining_params_path, '__palmmodel__')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册