MCPcopy
hub / github.com/PaddlePaddle/PaddleFormers / update_params

Function update_params

tests/testing_utils.py:402–413  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

400
401
402def 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
416class SubprocessCallException(Exception):

Callers

nothing calls this directly

Calls 2

loadMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected