From 0192b82f5bffcbd3a4b4a8737889270a78491498 Mon Sep 17 00:00:00 2001 From: Wenyu Date: Tue, 1 Jun 2021 11:23:53 +0800 Subject: [PATCH] Align download_filename with cached_filename (#33214) * Align download_filename with cached_filename --- python/paddle/hapi/hub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/hapi/hub.py b/python/paddle/hapi/hub.py index 54765c1d4d..243bd79c19 100644 --- a/python/paddle/hapi/hub.py +++ b/python/paddle/hapi/hub.py @@ -109,7 +109,9 @@ def _get_cache_or_reload(repo, force_reload, verbose=True, source='github'): url = _git_archive_link(repo_owner, repo_name, branch, source=source) - get_path_from_url(url, hub_dir, decompress=False) + fpath = get_path_from_url( + url, hub_dir, check_exist=not force_reload, decompress=False) + shutil.move(fpath, cached_file) with zipfile.ZipFile(cached_file) as cached_zipfile: extraced_repo_name = cached_zipfile.infolist()[0].filename -- GitLab