Adapter Training

Classes and methods related to training adapters.

class bool = False, load_adapter: Optional[str] = '', adapter_config: Optional[str] = 'pfeiffer', load_lang_adapter: Optional[str] = None, lang_adapter_config: Optional[str] = None)

The subset of arguments related to adapter training.

  • train_adapter (bool) – Whether to train an adapter instead of the full model.

  • load_adapter (str) – Pre-trained adapter module to be loaded from Hub.

  • adapter_config (str) – Adapter configuration. Either a config string or a path to a file.

  • load_lang_adapter (str) – Pre-trained language adapter module to be loaded from Hub.

  • lang_adapter_config (str) – Language adapter configuration. Either an identifier or a path to a file., adapter_args:, adapter_name: str, adapter_config_kwargs: Optional[dict] = None, adapter_load_kwargs: Optional[dict] = None)

Setup model for adapter training based on given adapter arguments.

  • model (_type_) – The model instance to be trained.

  • adapter_args (AdapterArguments) – The adapter arguments used for configuration.

  • adapter_name (str) – The name of the adapter to be added.


A tuple containing the names of the loaded adapters.

Return type

Tuple[str, str]