update params in json file Args: json_file (str): the path of json file params (dict): the parameters need to update
(json_file: str, params: dict)
| 400 | |
| 401 | |
| 402 | def update_params(json_file: str, params: dict): |
| 403 | """update params in json file |
| 404 | |
| 405 | Args: |
| 406 | json_file (str): the path of json file |
| 407 | params (dict): the parameters need to update |
| 408 | """ |
| 409 | with open(json_file, "r") as f: |
| 410 | data = json.load(f) |
| 411 | data.update(params) |
| 412 | with open(json_file, "w") as f: |
| 413 | json.dump(data, f, indent=2, ensure_ascii=False) |
| 414 | |
| 415 | |
| 416 | class SubprocessCallException(Exception): |