From a07f319e35cd6f9ca8840dc70524ea373d5d4728 Mon Sep 17 00:00:00 2001 From: Kaushik B <45285388+kaushikb11@users.noreply.github.com> Date: Sun, 7 Mar 2021 21:51:47 +0530 Subject: [PATCH] Update flash/core/data/utils.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Carlos MocholĂ­ --- flash/core/data/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flash/core/data/utils.py b/flash/core/data/utils.py index 380253789c..2d11f1bea3 100644 --- a/flash/core/data/utils.py +++ b/flash/core/data/utils.py @@ -37,7 +37,7 @@ def download_file(url: str, path: str, verbose: bool = False) -> None: if not os.path.exists(local_filename): r = requests.get(url, stream=True) - file_size = int(r.headers['Content-Length']) if 'Content-Length' in r.headers else 0 + file_size = int(r.headers.get('Content-Length', 0)) chunk = 1 chunk_size = 1024 num_bars = int(file_size / chunk_size)