From 49f2bbbaeb25e5f9394cc5aa78b4c43949da9237 Mon Sep 17 00:00:00 2001 From: sisminnmaw Date: Fri, 23 Aug 2024 00:10:47 +0900 Subject: [PATCH] fixed bug in download not enough disk space condition (#35) bug: used undeclared variable in download.py. when the disk space not enough NameError occured. --- llama_toolchain/cli/download.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llama_toolchain/cli/download.py b/llama_toolchain/cli/download.py index d0f2f7d3e..e2a709c6b 100644 --- a/llama_toolchain/cli/download.py +++ b/llama_toolchain/cli/download.py @@ -271,9 +271,10 @@ class ResumableDownloader: additional_size = self.total_size - self.downloaded_size if not self.has_disk_space(additional_size): + M = 1024 * 1024 # noqa print( f"Not enough disk space to download `{self.output_file}`. " - f"Required: {(additional_size / M):.2f} MB" + f"Required: {(additional_size // M):.2f} MB" ) raise ValueError( f"Not enough disk space to download `{self.output_file}`"