Update gguf-py/gguf/gguf_writer.py

Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
Christian Zhou-Zheng 2024-06-10 07:55:24 -04:00 committed by GitHub
parent c1b1a29266
commit 4550826871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -379,8 +379,7 @@ class GGUFWriter:
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
if total > 0:
shard_bar.reset(total=total)
shard_bar.reset(total=(total if total > 0 else None))
# relying on the fact that Python dicts preserve insertion order (since 3.7)
for ti in tensors.values():