def maybe_download(url, download_path, filename):
if not os.path.exists(os.path.join(download_path, filename)):
try:
print("Downloading file {}...".format(url + filename))
with TqdmUpTo(unit='B', unit_scale=True, miniters=1, desc=filename) as t:
local_filename, _ = urlretrieve(url, os.path.join(download_path, filename), reporthook=t.update_to)
except AttributeError as e:
print("An error occurred when downloading the file! Please get the dataset using a browser.")
raise e
评论列表
文章目录