MCPcopy
hub / github.com/microsoft/Cream / _update_config_from_file

Function _update_config_from_file

TinyViT/config.py:186–198  ·  view source on GitHub ↗
(config, cfg_file)

Source from the content-addressed store, hash-verified

184
185
186def _update_config_from_file(config, cfg_file):
187 config.defrost()
188 with open(cfg_file, 'r') as f:
189 yaml_cfg = yaml.load(f, Loader=yaml.FullLoader)
190
191 for cfg in yaml_cfg.setdefault('BASE', ['']):
192 if cfg:
193 _update_config_from_file(
194 config, os.path.join(os.path.dirname(cfg_file), cfg)
195 )
196 print('=> merge config from {}'.format(cfg_file))
197 config.merge_from_file(cfg_file)
198 config.freeze()
199
200
201def update_config(config, args):

Callers 1

update_configFunction · 0.70

Calls 2

formatMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected