Skip to content

Commit

Permalink
DOC Docstring of load_adapter, type annotation (#2087)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonmha authored Sep 23, 2024
1 parent b67c9b6 commit f4cf170
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/peft/peft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ def _update_offload(self, offload_index: dict[str, dict[str, str]], adapters_wei

def load_adapter(
self,
model_id: str,
model_id: Union[str, os.PathLike],
adapter_name: str,
is_trainable: bool = False,
torch_device: Optional[str] = None,
Expand All @@ -1125,10 +1125,14 @@ def load_adapter(
adapter.
Args:
model_id (`str` or `os.PathLike`):
The name of the PEFT configuration to use. Can be either:
- A string, the `model id` of a PEFT configuration hosted inside a model repo on the Hugging Face
Hub.
- A path to a directory containing a PEFT configuration file saved using the `save_pretrained`
method (`./my_peft_config_directory/`).
adapter_name (`str`):
The name of the adapter to be added.
peft_config ([`PeftConfig`]):
The configuration of the adapter to be added.
is_trainable (`bool`, *optional*, defaults to `False`):
Whether the adapter should be trainable or not. If `False`, the adapter will be frozen and can only be
used for inference.
Expand Down

0 comments on commit f4cf170

Please sign in to comment.