MCPcopy Create free account
hub / github.com/THUDM/GLM / from_dict

Method from_dict

model/modeling_bert.py:238–243  ·  view source on GitHub ↗

Constructs a `BertConfig` from a Python dictionary of parameters.

(cls, json_object)

Source from the content-addressed store, hash-verified

236
237 @classmethod
238 def from_dict(cls, json_object):
239 """Constructs a `BertConfig` from a Python dictionary of parameters."""
240 config = BertConfig(vocab_size_or_config_json_file=-1)
241 for key, value in json_object.items():
242 config.__dict__[key] = value
243 return config
244
245 @classmethod
246 def from_json_file(cls, json_file):

Callers 1

from_json_fileMethod · 0.80

Calls 1

BertConfigClass · 0.85

Tested by

no test coverage detected