Spaces:
Paused
Paused
Python 3.8 fixes
Browse files- mappingservice/utils.py +4 -1
mappingservice/utils.py
CHANGED
@@ -21,7 +21,10 @@ def log_memory_usage():
|
|
21 |
|
22 |
|
23 |
def safe_round(value, decimals=0):
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
def process_predictions(predictions, score_key="score", label_key="label"):
|
|
|
21 |
|
22 |
|
23 |
def safe_round(value, decimals=0):
|
24 |
+
if isinstance(value, int) or isinstance(value, float):
|
25 |
+
return round(value, decimals)
|
26 |
+
|
27 |
+
return 0
|
28 |
|
29 |
|
30 |
def process_predictions(predictions, score_key="score", label_key="label"):
|