Spaces:
Sleeping
Sleeping
Sarkosos
commited on
Commit
·
9da9693
1
Parent(s):
2ebf70b
Added a check to make sure sizes are not None
Browse files- .gitignore +1 -0
- utils.py +8 -1
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
venv/
|
utils.py
CHANGED
|
@@ -118,7 +118,14 @@ def convert_unit(value, from_unit, to_unit):
|
|
| 118 |
|
| 119 |
def get_total_file_sizes(run):
|
| 120 |
"""returns total size of byte strings in bytes"""
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
return convert_unit(size_bytes, from_unit='B', to_unit=BASE_UNITS)
|
| 123 |
|
| 124 |
def get_total_md_input_sizes(run):
|
|
|
|
| 118 |
|
| 119 |
def get_total_file_sizes(run):
|
| 120 |
"""returns total size of byte strings in bytes"""
|
| 121 |
+
# for sizes in run.summary.get('response_returned_files_sizes',[[]]):
|
| 122 |
+
# if sizes and sized is not None:
|
| 123 |
+
# for size in sizes:
|
| 124 |
+
file_sizes = run.summary.get('response_returned_files_sizes',[[]])
|
| 125 |
+
if file_sizes is None:
|
| 126 |
+
return 0
|
| 127 |
+
|
| 128 |
+
size_bytes = sum(size for sizes in file_sizes for size in sizes if sizes and sizes is not None)
|
| 129 |
return convert_unit(size_bytes, from_unit='B', to_unit=BASE_UNITS)
|
| 130 |
|
| 131 |
def get_total_md_input_sizes(run):
|