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)
| 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.') |
no outgoing calls