From 881a8fb2d76906dd417218ceec758ae9a9639d1b Mon Sep 17 00:00:00 2001 From: Zhang Liliang Date: Wed, 15 Jul 2020 17:27:00 +0800 Subject: [PATCH] Update utils.py Fix a bug in function download_url. It should return the filepath if the file has already been downloaded, otherwise the function would return None. Then, an error would be occurred. --- ofa/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ofa/utils.py b/ofa/utils.py index 3e99798a..9c862c4e 100644 --- a/ofa/utils.py +++ b/ofa/utils.py @@ -188,6 +188,8 @@ def download_url(url, model_dir='~/.torch/', overwrite=False): # If fail, then ensure the lock is removed so download can be executed next time. print("Failed to download from url %s" % url + "\n" + str(e) + "\n") return str(e) + + return filepath