diff --git a/gguf-py/gguf/gguf_writer.py b/gguf-py/gguf/gguf_writer.py index 7d204a0e7e3ae..099f99cd8a377 100644 --- a/gguf-py/gguf/gguf_writer.py +++ b/gguf-py/gguf/gguf_writer.py @@ -375,7 +375,7 @@ def write_tensors_to_file(self, *, progress: bool = False) -> None: shard_bar = tqdm(desc=f"Shard (1/{len(self.fout)})", total=total_bytes, unit="byte", unit_scale=True) for i, (fout, tensors) in enumerate(zip(self.fout, self.tensors)): - if shard_bar and len(self.fout) > 1: + if shard_bar is not None: shard_bar.set_description(f"Shard ({i + 1}/{len(self.fout)})") total = sum(ti.nbytes for ti in tensors.values()) # bar behaves weirdly when total is 0