From dc513028e99be2f303e9f4e9b03d118328af87aa Mon Sep 17 00:00:00 2001 From: Costa Huang Date: Tue, 21 Nov 2023 23:54:33 -0500 Subject: [PATCH 1/2] add correct type annotation --- src/peft/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/peft/config.py b/src/peft/config.py index 63f4ad6eea..0d15ca9fe6 100644 --- a/src/peft/config.py +++ b/src/peft/config.py @@ -213,10 +213,10 @@ class PeftConfig(PeftConfigMixin): inference_mode (`bool`, defaults to `False`): Whether to use the Peft model in inference mode. """ - base_model_name_or_path: str = field(default=None, metadata={"help": "The name of the base model to use."}) - revision: str = field(default=None, metadata={"help": "The specific model version to use."}) - peft_type: Union[str, PeftType] = field(default=None, metadata={"help": "Peft type"}) - task_type: Union[str, TaskType] = field(default=None, metadata={"help": "Task type"}) + base_model_name_or_path: Optional[str] = field(default=None, metadata={"help": "The name of the base model to use."}) + revision: Optional[str] = field(default=None, metadata={"help": "The specific model version to use."}) + peft_type: Optional[Union[str, PeftType]] = field(default=None, metadata={"help": "Peft type"}) + task_type: Optional[Union[str, TaskType]] = field(default=None, metadata={"help": "Task type"}) inference_mode: bool = field(default=False, metadata={"help": "Whether to use inference mode"}) From c8515d84f2357b7b4be24c9cf32a037642a98781 Mon Sep 17 00:00:00 2001 From: Costa Huang Date: Wed, 22 Nov 2023 09:58:44 -0500 Subject: [PATCH 2/2] make style --- src/peft/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/peft/config.py b/src/peft/config.py index 0d15ca9fe6..1916a6a3c9 100644 --- a/src/peft/config.py +++ b/src/peft/config.py @@ -213,7 +213,9 @@ class PeftConfig(PeftConfigMixin): inference_mode (`bool`, defaults to `False`): Whether to use the Peft model in inference mode. """ - base_model_name_or_path: Optional[str] = field(default=None, metadata={"help": "The name of the base model to use."}) + base_model_name_or_path: Optional[str] = field( + default=None, metadata={"help": "The name of the base model to use."} + ) revision: Optional[str] = field(default=None, metadata={"help": "The specific model version to use."}) peft_type: Optional[Union[str, PeftType]] = field(default=None, metadata={"help": "Peft type"}) task_type: Optional[Union[str, TaskType]] = field(default=None, metadata={"help": "Task type"})