提交 1a316d55 编写于 作者: Z Zeyu Chen

upgrade licence

上级 9dfd6e56
Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
......@@ -186,7 +188,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
......@@ -26,14 +26,8 @@ import hashlib
import requests
import tempfile
import tarfile
"""
tqdm prograss hook
"""
__all__ = [
'MODULE_HOME', 'download', 'md5file', 'split', 'cluster_files_reader',
'convert', 'download_and_uncompress'
]
__all__ = ['MODULE_HOME', 'download', 'md5file', 'download_and_uncompress']
# TODO(ZeyuChen) add environment varialble to set MODULE_HOME
MODULE_HOME = os.path.expanduser('~/.cache/paddle/module')
......@@ -119,6 +113,9 @@ def download_and_uncompress(url, save_name=None):
class TqdmProgress(tqdm):
"""
tqdm prograss hook
"""
last_block = 0
def update_to(self, block_num=1, block_size=1, total_size=None):
......
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
import paddle_hub as hub
import numpy as np
# import paddle_hub as hub
import tempfile
import os
from collections import defaultdict
from paddle_hub.downloader import download_and_uncompress
__all__ = ["Module", "ModuleSpec"]
class Module(object):
def __init__(self, module_url):
......
......@@ -12,15 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import downloader as dl
import unittest
import downloader as dl
class TestDownloader(unittest.TestCase):
def test_download(self):
link = "http://paddlehub.bj.bcebos.com/word2vec/word2vec-dim16-simple-example-1.tar.gz"
module_path = dl.
ownload_and_uncompress(link)
module_path = dl.download_and_uncompress(link)
if __name__ == "__main__":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册