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

Method save_pretrained

modelscope/models/base/base_model.py:238–257  ·  view source on GitHub ↗

save the pretrained model, its configuration and other related files to a directory, so that it can be re-loaded Args: target_folder (Union[str, os.PathLike]): Directory to which to save. Will be created if it doesn't exist. save_checkpoint_n

(self,
                        target_folder: Union[str, os.PathLike],
                        save_checkpoint_names: Union[str, List[str]] = None,
                        config: Optional[dict] = None,
                        **kwargs)

Source from the content-addressed store, hash-verified

236 return model
237
238 def save_pretrained(self,
239 target_folder: Union[str, os.PathLike],
240 save_checkpoint_names: Union[str, List[str]] = None,
241 config: Optional[dict] = None,
242 **kwargs):
243 """save the pretrained model, its configuration and other related files to a directory,
244 so that it can be re-loaded
245
246 Args:
247 target_folder (Union[str, os.PathLike]):
248 Directory to which to save. Will be created if it doesn't exist.
249
250 save_checkpoint_names (Union[str, List[str]]):
251 The checkpoint names to be saved in the target_folder
252
253 config (Optional[dict], optional):
254 The config for the configuration.json, might not be identical with model.config
255 """
256 raise NotImplementedError(
257 'save_pretrained method need to be implemented by the subclass.')

Callers 12

_weight_diffFunction · 0.45
export_onnxMethod · 0.45
save_transformerFunction · 0.45
save_checkpointsMethod · 0.45
save_checkpointsMethod · 0.45
save_checkpointsMethod · 0.45
test_save_pretrainedMethod · 0.45
test_save_pretrainedMethod · 0.45

Calls

no outgoing calls

Tested by 3

test_save_pretrainedMethod · 0.36
test_save_pretrainedMethod · 0.36