Skip to content

Commit

Permalink
Update gguf-py/gguf/gguf_writer.py
Browse files Browse the repository at this point in the history
Co-authored-by: compilade <[email protected]>
  • Loading branch information
christianazinn and compilade authored Jun 10, 2024
1 parent c1b1a29 commit 4550826
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gguf-py/gguf/gguf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ def write_tensors_to_file(self, *, progress: bool = False) -> 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
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():
Expand Down

0 comments on commit 4550826

Please sign in to comment.