MCPcopy Create free account
hub / github.com/SooLab/CGFormer / to_json_file

Method to_json_file

bert/configuration_utils.py:386–397  ·  view source on GitHub ↗

Save this instance to a json file. Args: json_file_path (:obj:`string`): Path to the JSON file in which this configuration instance's parameters will be saved. use_diff (:obj:`bool`): If set to True, only the difference betwee

(self, json_file_path, use_diff=True)

Source from the content-addressed store, hash-verified

384 return json.dumps(config_dict, indent=2, sort_keys=True) + "\n"
385
386 def to_json_file(self, json_file_path, use_diff=True):
387 """
388 Save this instance to a json file.
389
390 Args:
391 json_file_path (:obj:`string`):
392 Path to the JSON file in which this configuration instance's parameters will be saved.
393 use_diff (:obj:`bool`):
394 If set to True, only the difference between the config instance and the default PretrainedConfig() is serialized to JSON file.
395 """
396 with open(json_file_path, "w", encoding="utf-8") as writer:
397 writer.write(self.to_json_string(use_diff=use_diff))
398
399 def update(self, config_dict: Dict):
400 """

Callers 1

save_pretrainedMethod · 0.95

Calls 2

to_json_stringMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected