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

Method from_json_file

bert/configuration_utils.py:307–320  ·  view source on GitHub ↗

Constructs a `Config` from the path to a json file of parameters. Args: json_file (:obj:`string`): Path to the JSON file containing the parameters. Returns: :class:`PretrainedConfig`: An instance of a configuration object

(cls, json_file: str)

Source from the content-addressed store, hash-verified

305
306 @classmethod
307 def from_json_file(cls, json_file: str) -> "PretrainedConfig":
308 """
309 Constructs a `Config` from the path to a json file of parameters.
310
311 Args:
312 json_file (:obj:`string`):
313 Path to the JSON file containing the parameters.
314
315 Returns:
316 :class:`PretrainedConfig`: An instance of a configuration object
317
318 """
319 config_dict = cls._dict_from_json_file(json_file)
320 return cls(**config_dict)
321
322 @classmethod
323 def _dict_from_json_file(cls, json_file: str):

Callers

nothing calls this directly

Calls 1

_dict_from_json_fileMethod · 0.80

Tested by

no test coverage detected