MCPcopy
hub / github.com/EleutherAI/gpt-neox / get_key

Function get_key

tools/convert_to_hf.py:60–72  ·  view source on GitHub ↗

Search for a given key in a NeoX yaml. normalizes underscores -> hyphens

(loaded_config, key, default=None)

Source from the content-addressed store, hash-verified

58
59
60def get_key(loaded_config, key, default=None):
61 """
62 Search for a given key in a NeoX yaml. normalizes underscores -> hyphens
63 """
64 key = key.replace("_", "-")
65 try:
66 return loaded_config[key]
67 except KeyError:
68 key = key.replace("-", "_")
69 try:
70 return loaded_config[key]
71 except KeyError:
72 return default
73
74
75def create_config(neox_config):

Callers 4

__init__Method · 0.85
create_configFunction · 0.85
convertFunction · 0.85
convert_to_hf.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected