Expand description
Human-readable byte-size formatting.
Sizes are decimal (4.9 GB is 4.9e9 bytes, not 4.9 GiB), which is how
the hubs and a model’s own page state them; memory is binary and keeps
its own GiB figures through the constants below.
Constants§
- BYTES_
PER_ GIB - Bytes in one gibibyte, for memory figures.
- BYTES_
PER_ MIB - Bytes in one mebibyte, for the memory figures budgeted in them.
Functions§
- format_
bytes - Format a byte count as a short human string (
B/KB/MB/GB). Gigabytes get one decimal place, with a trailing.0trimmed. - one_
decimal valuewith one decimal place, a trailing.0trimmed:4.7,64.