in train.py [0:0]
def convert_config_types(obj):
if isinstance(obj, dict):
return {k: convert_config_types(v) for k, v in obj.items()}
elif isinstance(obj, list):
return [convert_config_types(item) for item in obj]
elif isinstance(obj, str):
# Try to convert to int, then float; if both fail, keep as string.
try:
return int(obj)
except ValueError:
try:
return float(obj)
except ValueError:
return obj
else:
return obj