in evaluation_pipeline/retrieval.py [0:0]
def format_size(size_in_bytes):
"""Convert bytes to a human-readable format (KB, MB, GB, etc.)."""
for unit in ['B', 'KB', 'MB', 'GB', 'TB']:
if size_in_bytes < 1024:
return f"{size_in_bytes:.2f} {unit}"
size_in_bytes /= 1024