mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-28 10:54:19 +00:00
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.
This commit is contained in:
parent
b4af8c0e00
commit
49f2bbbaeb
1 changed files with 2 additions and 1 deletions
|
@ -271,9 +271,10 @@ class ResumableDownloader:
|
||||||
|
|
||||||
additional_size = self.total_size - self.downloaded_size
|
additional_size = self.total_size - self.downloaded_size
|
||||||
if not self.has_disk_space(additional_size):
|
if not self.has_disk_space(additional_size):
|
||||||
|
M = 1024 * 1024 # noqa
|
||||||
print(
|
print(
|
||||||
f"Not enough disk space to download `{self.output_file}`. "
|
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(
|
raise ValueError(
|
||||||
f"Not enough disk space to download `{self.output_file}`"
|
f"Not enough disk space to download `{self.output_file}`"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue