From f428f836c2f10ed11dc3b2313ba51a0212234406 Mon Sep 17 00:00:00 2001 From: wangxiao Date: Tue, 3 Dec 2019 21:13:50 +0800 Subject: [PATCH] remove :gz --- paddlepalm/_downloader.py | 4 ++-- paddlepalm/utils/saver.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddlepalm/_downloader.py b/paddlepalm/_downloader.py index d5c950f..f92443f 100644 --- a/paddlepalm/_downloader.py +++ b/paddlepalm/_downloader.py @@ -28,7 +28,7 @@ import ssl __all__ = ["download", "ls"] # for https -ssl._create_default_https_context = ssl._create_unverified_context +# ssl._create_default_https_context = ssl._create_unverified_context _items = { 'pretrain': {'ernie-en-uncased-large': 'https://ernie.bj.bcebos.com/ERNIE_Large_en_stable-2.0.0.tar.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: diff --git a/paddlepalm/utils/saver.py b/paddlepalm/utils/saver.py index 2ec4c9f..ab6d288 100644 --- a/paddlepalm/utils/saver.py +++ b/paddlepalm/utils/saver.py @@ -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__') -- GitLab