MCPcopy Create free account
hub / github.com/modelscope/modelscope / save_configuration

Function save_configuration

modelscope/utils/checkpoint.py:574–581  ·  view source on GitHub ↗
(target_folder, config: Dict)

Source from the content-addressed store, hash-verified

572
573
574def save_configuration(target_folder, config: Dict):
575 if isinstance(config, Config):
576 config = config.to_dict()
577 if ConfigFields.pipeline not in config:
578 config[ConfigFields.pipeline] = {'type': config[ConfigFields.task]}
579 cfg_str = json.dumps(config, indent=4, cls=JSONIteratorEncoder)
580 config_file = os.path.join(target_folder, ModelFile.CONFIGURATION)
581 storage.write(cfg_str.encode(), config_file)
582
583
584def save_pretrained(model,

Callers 2

save_configMethod · 0.90
save_configMethod · 0.90

Calls 4

to_dictMethod · 0.45
dumpsMethod · 0.45
writeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…