Skip to content

Commit

Permalink
Fix hints and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Arsh Zahed authored and Arsh Zahed committed Nov 18, 2024
1 parent 306aa41 commit 9a1ce5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/together/cli/api/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def fine_tuning(ctx: click.Context) -> None:
"--min-lr-ratio",
type=float,
default=0.0,
help="Final learning rate ratio of the initial learning rate",
help="The ratio of the final learning rate to the peak learning rate",
)
@click.option(
"--warmup-ratio",
Expand All @@ -81,7 +81,7 @@ def fine_tuning(ctx: click.Context) -> None:
"--max-grad-norm",
type=float,
default=1.0,
help="Max gradient norm. Set to 0 to disable.",
help="Max gradient norm to be used for gradient clipping. Set to 0 to disable.",
)
@click.option(
"--weight-decay",
Expand Down
8 changes: 4 additions & 4 deletions src/together/resources/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def create(
n_checkpoints: int | None = 1,
batch_size: int | Literal["max"] = "max",
learning_rate: float | None = 0.00001,
min_lr_ratio: float | None = 0.0,
min_lr_ratio: float = 0.0,
warmup_ratio: float | None = 0.0,
max_grad_norm: float = 1.0,
weight_decay: float = 0.0,
Expand Down Expand Up @@ -171,7 +171,7 @@ def create(
min_lr_ratio (float, optional): Min learning rate ratio of the initial learning rate for
the learning rate scheduler. Defaults to 0.0.
warmup_ratio (float, optional): Warmup ratio for learning rate scheduler.
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0. Set to 0 to disable.
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0, set to 0 to disable.
weight_decay (float, optional): Weight decay. Defaults to 0.0.
lora (bool, optional): Whether to use LoRA adapters. Defaults to True.
lora_r (int, optional): Rank of LoRA adapters. Defaults to 8.
Expand Down Expand Up @@ -468,7 +468,7 @@ async def create(
n_checkpoints: int | None = 1,
batch_size: int | Literal["max"] = "max",
learning_rate: float | None = 0.00001,
min_lr_ratio: float | None = 0.0,
min_lr_ratio: float = 0.0,
warmup_ratio: float | None = 0.0,
max_grad_norm: float = 1.0,
weight_decay: float = 0.0,
Expand Down Expand Up @@ -500,7 +500,7 @@ async def create(
min_lr_ratio (float, optional): Min learning rate ratio of the initial learning rate for
the learning rate scheduler. Defaults to 0.0.
warmup_ratio (float, optional): Warmup ratio for learning rate scheduler.
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0. Set to 0 to disable.
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0, set to 0 to disable.
weight_decay (float, optional): Weight decay. Defaults to 0.0.
lora (bool, optional): Whether to use LoRA adapters. Defaults to True.
lora_r (int, optional): Rank of LoRA adapters. Defaults to 8.
Expand Down
4 changes: 2 additions & 2 deletions src/together/types/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ class FinetuneRequest(BaseModel):
# learning rate warmup ratio
warmup_ratio: float
# max gradient norm
max_grad_norm: float | None = None
max_grad_norm: float
# weight decay
weight_decay: float | None = None
weight_decay: float
# number of checkpoints to save
n_checkpoints: int | None = None
# number of evaluation loops to run
Expand Down

0 comments on commit 9a1ce5f

Please sign in to comment.