From 89fb6f9236849a66920e20716240343edc0f3d9d Mon Sep 17 00:00:00 2001 From: Gaurav Bhagchandani Date: Wed, 21 Jun 2023 11:31:50 -0400 Subject: [PATCH] Fixed the ZeroDivisionError when downloading a model (#2797) --- download-model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download-model.py b/download-model.py index 7aea77be..e04aedc3 100644 --- a/download-model.py +++ b/download-model.py @@ -149,7 +149,7 @@ class ModelDownloader: for data in r.iter_content(block_size): t.update(len(data)) f.write(data) - if self.progress_bar is not None: + if total_size != 0 and self.progress_bar is not None: count += len(data) self.progress_bar(float(count) / float(total_size), f"Downloading {filename}")