File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -2481,7 +2481,10 @@ def update_model_properties(
2481
2481
"can be generated."
2482
2482
)
2483
2483
for key in update_dict :
2484
- model_files [PROP ][key ] = update_dict [key ]
2484
+ if not isinstance (update_dict [key ], str ):
2485
+ model_files [PROP ][key ] = str (round (update_dict [key ], 14 ))
2486
+ else :
2487
+ model_files [PROP ][key ] = update_dict [key ]
2485
2488
else :
2486
2489
if not Path .exists (Path (model_files ) / PROP ):
2487
2490
raise RuntimeError (
@@ -2490,8 +2493,10 @@ def update_model_properties(
2490
2493
)
2491
2494
with open (Path (model_files ) / PROP , 'r+' ) as properties_json :
2492
2495
model_properties = json .load (properties_json )
2493
- for key in update_dict :
2494
- model_properties [key ] = update_dict [key ]
2496
+ if not isinstance (update_dict [key ], str ):
2497
+ model_files [PROP ][key ] = str (round (update_dict [key ], 14 ))
2498
+ else :
2499
+ model_files [PROP ][key ] = update_dict [key ]
2495
2500
properties_json .seek (0 )
2496
2501
properties_json .write (json .dumps (model_properties , indent = 4 , cls = NpEncoder ))
2497
2502
properties_json .truncate ()
You can’t perform that action at this time.
0 commit comments