From ff339871f3f6d975ec1aa449baae74339e992a40 Mon Sep 17 00:00:00 2001 From: Santiago Castro Date: Mon, 9 Aug 2021 00:20:38 -0600 Subject: [PATCH] Use tqdm with 1024 instead of 1000 unit scale (#131) --- clip/clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clip/clip.py b/clip/clip.py index b1e4140..0f6c99c 100644 --- a/clip/clip.py +++ b/clip/clip.py @@ -53,7 +53,7 @@ def _download(url: str, root: str = os.path.expanduser("~/.cache/clip")): warnings.warn(f"{download_target} exists, but the SHA256 checksum does not match; re-downloading the file") with urllib.request.urlopen(url) as source, open(download_target, "wb") as output: - with tqdm(total=int(source.info().get("Content-Length")), ncols=80, unit='iB', unit_scale=True) as loop: + with tqdm(total=int(source.info().get("Content-Length")), ncols=80, unit='iB', unit_scale=True, unit_divisor=1024) as loop: while True: buffer = source.read(8192) if not buffer: