SwiftConfig

class swift.tuners.utils.SwiftConfig(swift_type: str = None, model_key_mapping: dict | swift.utils.module_mapping.ModelKeys | NoneType = None)[源代码]
save_pretrained(save_directory, **kwargs)[源代码]

This method saves the configuration of your adapter model in a directory.

参数:

save_directory (str) -- The directory where the configuration will be saved.

classmethod from_pretrained(pretrained_model_name_or_path, **kwargs)[源代码]

This method loads the configuration of your adapter model from a directory.

参数:
  • pretrained_model_name_or_path (str) -- The directory or the hub-id where the configuration is saved.

  • **kwargs -- Additional keyword arguments passed along to the child class initialization.

classmethod from_json_file(path_json_file, **kwargs)[源代码]

Loads a configuration file from a json file.

参数:

path_json_file (str) -- The path to the json file.