together 1.4.6__py3-none-any.whl → 1.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- together/cli/api/finetune.py +46 -9
- together/resources/finetune.py +70 -13
- together/types/__init__.py +7 -1
- together/types/finetune.py +21 -7
- {together-1.4.6.dist-info → together-1.5.2.dist-info}/METADATA +3 -4
- {together-1.4.6.dist-info → together-1.5.2.dist-info}/RECORD +9 -9
- {together-1.4.6.dist-info → together-1.5.2.dist-info}/LICENSE +0 -0
- {together-1.4.6.dist-info → together-1.5.2.dist-info}/WHEEL +0 -0
- {together-1.4.6.dist-info → together-1.5.2.dist-info}/entry_points.txt +0 -0
together/cli/api/finetune.py
CHANGED
|
@@ -58,30 +58,50 @@ def fine_tuning(ctx: click.Context) -> None:
|
|
|
58
58
|
@fine_tuning.command()
|
|
59
59
|
@click.pass_context
|
|
60
60
|
@click.option(
|
|
61
|
-
"--training-file",
|
|
61
|
+
"--training-file",
|
|
62
|
+
"-t",
|
|
63
|
+
type=str,
|
|
64
|
+
required=True,
|
|
65
|
+
help="Training file ID from Files API",
|
|
66
|
+
)
|
|
67
|
+
@click.option("--model", "-m", type=str, help="Base model name")
|
|
68
|
+
@click.option(
|
|
69
|
+
"--n-epochs", "-ne", type=int, default=1, help="Number of epochs to train for"
|
|
62
70
|
)
|
|
63
|
-
@click.option("--model", type=str, required=True, help="Base model name")
|
|
64
|
-
@click.option("--n-epochs", type=int, default=1, help="Number of epochs to train for")
|
|
65
71
|
@click.option(
|
|
66
72
|
"--validation-file", type=str, default="", help="Validation file ID from Files API"
|
|
67
73
|
)
|
|
68
74
|
@click.option("--n-evals", type=int, default=0, help="Number of evaluation loops")
|
|
69
75
|
@click.option(
|
|
70
|
-
"--n-checkpoints", type=int, default=1, help="Number of checkpoints to save"
|
|
76
|
+
"--n-checkpoints", "-c", type=int, default=1, help="Number of checkpoints to save"
|
|
77
|
+
)
|
|
78
|
+
@click.option(
|
|
79
|
+
"--batch-size", "-b", type=INT_WITH_MAX, default="max", help="Train batch size"
|
|
80
|
+
)
|
|
81
|
+
@click.option("--learning-rate", "-lr", type=float, default=1e-5, help="Learning rate")
|
|
82
|
+
@click.option(
|
|
83
|
+
"--lr-scheduler-type",
|
|
84
|
+
type=click.Choice(["linear", "cosine"]),
|
|
85
|
+
default="linear",
|
|
86
|
+
help="Learning rate scheduler type",
|
|
71
87
|
)
|
|
72
|
-
@click.option("--batch-size", type=INT_WITH_MAX, default="max", help="Train batch size")
|
|
73
|
-
@click.option("--learning-rate", type=float, default=1e-5, help="Learning rate")
|
|
74
88
|
@click.option(
|
|
75
89
|
"--min-lr-ratio",
|
|
76
90
|
type=float,
|
|
77
91
|
default=0.0,
|
|
78
92
|
help="The ratio of the final learning rate to the peak learning rate",
|
|
79
93
|
)
|
|
94
|
+
@click.option(
|
|
95
|
+
"--scheduler-num-cycles",
|
|
96
|
+
type=float,
|
|
97
|
+
default=0.5,
|
|
98
|
+
help="Number or fraction of cycles for the cosine learning rate scheduler.",
|
|
99
|
+
)
|
|
80
100
|
@click.option(
|
|
81
101
|
"--warmup-ratio",
|
|
82
102
|
type=float,
|
|
83
103
|
default=0.0,
|
|
84
|
-
help="Warmup ratio for learning rate scheduler.",
|
|
104
|
+
help="Warmup ratio for the learning rate scheduler.",
|
|
85
105
|
)
|
|
86
106
|
@click.option(
|
|
87
107
|
"--max-grad-norm",
|
|
@@ -123,7 +143,11 @@ def fine_tuning(ctx: click.Context) -> None:
|
|
|
123
143
|
help="Beta parameter for DPO training (only used when '--training-method' is 'dpo')",
|
|
124
144
|
)
|
|
125
145
|
@click.option(
|
|
126
|
-
"--suffix",
|
|
146
|
+
"--suffix",
|
|
147
|
+
"-s",
|
|
148
|
+
type=str,
|
|
149
|
+
default=None,
|
|
150
|
+
help="Suffix for the fine-tuned model name",
|
|
127
151
|
)
|
|
128
152
|
@click.option("--wandb-api-key", type=str, default=None, help="Wandb API key")
|
|
129
153
|
@click.option("--wandb-base-url", type=str, default=None, help="Wandb base URL")
|
|
@@ -162,7 +186,9 @@ def create(
|
|
|
162
186
|
n_checkpoints: int,
|
|
163
187
|
batch_size: int | Literal["max"],
|
|
164
188
|
learning_rate: float,
|
|
189
|
+
lr_scheduler_type: Literal["linear", "cosine"],
|
|
165
190
|
min_lr_ratio: float,
|
|
191
|
+
scheduler_num_cycles: float,
|
|
166
192
|
warmup_ratio: float,
|
|
167
193
|
max_grad_norm: float,
|
|
168
194
|
weight_decay: float,
|
|
@@ -194,7 +220,9 @@ def create(
|
|
|
194
220
|
n_checkpoints=n_checkpoints,
|
|
195
221
|
batch_size=batch_size,
|
|
196
222
|
learning_rate=learning_rate,
|
|
223
|
+
lr_scheduler_type=lr_scheduler_type,
|
|
197
224
|
min_lr_ratio=min_lr_ratio,
|
|
225
|
+
scheduler_num_cycles=scheduler_num_cycles,
|
|
198
226
|
warmup_ratio=warmup_ratio,
|
|
199
227
|
max_grad_norm=max_grad_norm,
|
|
200
228
|
weight_decay=weight_decay,
|
|
@@ -214,8 +242,15 @@ def create(
|
|
|
214
242
|
from_checkpoint=from_checkpoint,
|
|
215
243
|
)
|
|
216
244
|
|
|
245
|
+
if model is None and from_checkpoint is None:
|
|
246
|
+
raise click.BadParameter("You must specify either a model or a checkpoint")
|
|
247
|
+
|
|
248
|
+
model_name = model
|
|
249
|
+
if from_checkpoint is not None:
|
|
250
|
+
model_name = from_checkpoint.split(":")[0]
|
|
251
|
+
|
|
217
252
|
model_limits: FinetuneTrainingLimits = client.fine_tuning.get_model_limits(
|
|
218
|
-
model=
|
|
253
|
+
model=model_name
|
|
219
254
|
)
|
|
220
255
|
|
|
221
256
|
if lora:
|
|
@@ -411,6 +446,7 @@ def list_checkpoints(ctx: click.Context, fine_tune_id: str) -> None:
|
|
|
411
446
|
@click.argument("fine_tune_id", type=str, required=True)
|
|
412
447
|
@click.option(
|
|
413
448
|
"--output_dir",
|
|
449
|
+
"-o",
|
|
414
450
|
type=click.Path(exists=True, file_okay=False, resolve_path=True),
|
|
415
451
|
required=False,
|
|
416
452
|
default=None,
|
|
@@ -418,6 +454,7 @@ def list_checkpoints(ctx: click.Context, fine_tune_id: str) -> None:
|
|
|
418
454
|
)
|
|
419
455
|
@click.option(
|
|
420
456
|
"--checkpoint-step",
|
|
457
|
+
"-s",
|
|
421
458
|
type=int,
|
|
422
459
|
required=False,
|
|
423
460
|
default=None,
|
together/resources/finetune.py
CHANGED
|
@@ -22,7 +22,10 @@ from together.types import (
|
|
|
22
22
|
TogetherRequest,
|
|
23
23
|
TrainingType,
|
|
24
24
|
FinetuneLRScheduler,
|
|
25
|
+
FinetuneLinearLRScheduler,
|
|
26
|
+
FinetuneCosineLRScheduler,
|
|
25
27
|
FinetuneLinearLRSchedulerArgs,
|
|
28
|
+
FinetuneCosineLRSchedulerArgs,
|
|
26
29
|
TrainingMethodDPO,
|
|
27
30
|
TrainingMethodSFT,
|
|
28
31
|
FinetuneCheckpoint,
|
|
@@ -50,14 +53,16 @@ AVAILABLE_TRAINING_METHODS = {
|
|
|
50
53
|
def createFinetuneRequest(
|
|
51
54
|
model_limits: FinetuneTrainingLimits,
|
|
52
55
|
training_file: str,
|
|
53
|
-
model: str,
|
|
56
|
+
model: str | None = None,
|
|
54
57
|
n_epochs: int = 1,
|
|
55
58
|
validation_file: str | None = "",
|
|
56
59
|
n_evals: int | None = 0,
|
|
57
60
|
n_checkpoints: int | None = 1,
|
|
58
61
|
batch_size: int | Literal["max"] = "max",
|
|
59
62
|
learning_rate: float | None = 0.00001,
|
|
63
|
+
lr_scheduler_type: Literal["linear", "cosine"] = "linear",
|
|
60
64
|
min_lr_ratio: float = 0.0,
|
|
65
|
+
scheduler_num_cycles: float = 0.5,
|
|
61
66
|
warmup_ratio: float = 0.0,
|
|
62
67
|
max_grad_norm: float = 1.0,
|
|
63
68
|
weight_decay: float = 0.0,
|
|
@@ -77,6 +82,11 @@ def createFinetuneRequest(
|
|
|
77
82
|
from_checkpoint: str | None = None,
|
|
78
83
|
) -> FinetuneRequest:
|
|
79
84
|
|
|
85
|
+
if model is not None and from_checkpoint is not None:
|
|
86
|
+
raise ValueError(
|
|
87
|
+
"You must specify either a model or a checkpoint to start a job from, not both"
|
|
88
|
+
)
|
|
89
|
+
|
|
80
90
|
if batch_size == "max":
|
|
81
91
|
log_warn_once(
|
|
82
92
|
"Starting from together>=1.3.0, "
|
|
@@ -129,10 +139,22 @@ def createFinetuneRequest(
|
|
|
129
139
|
f"training_method must be one of {', '.join(AVAILABLE_TRAINING_METHODS)}"
|
|
130
140
|
)
|
|
131
141
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
# Default to generic lr scheduler
|
|
143
|
+
lrScheduler: FinetuneLRScheduler = FinetuneLRScheduler(lr_scheduler_type="linear")
|
|
144
|
+
|
|
145
|
+
if lr_scheduler_type == "cosine":
|
|
146
|
+
if scheduler_num_cycles <= 0.0:
|
|
147
|
+
raise ValueError("Number of cycles should be greater than 0")
|
|
148
|
+
|
|
149
|
+
lrScheduler = FinetuneCosineLRScheduler(
|
|
150
|
+
lr_scheduler_args=FinetuneCosineLRSchedulerArgs(
|
|
151
|
+
min_lr_ratio=min_lr_ratio, num_cycles=scheduler_num_cycles
|
|
152
|
+
),
|
|
153
|
+
)
|
|
154
|
+
else:
|
|
155
|
+
lrScheduler = FinetuneLinearLRScheduler(
|
|
156
|
+
lr_scheduler_args=FinetuneLinearLRSchedulerArgs(min_lr_ratio=min_lr_ratio),
|
|
157
|
+
)
|
|
136
158
|
|
|
137
159
|
training_method_cls: TrainingMethodSFT | TrainingMethodDPO = TrainingMethodSFT()
|
|
138
160
|
if training_method == "dpo":
|
|
@@ -237,14 +259,16 @@ class FineTuning:
|
|
|
237
259
|
self,
|
|
238
260
|
*,
|
|
239
261
|
training_file: str,
|
|
240
|
-
model: str,
|
|
262
|
+
model: str | None = None,
|
|
241
263
|
n_epochs: int = 1,
|
|
242
264
|
validation_file: str | None = "",
|
|
243
265
|
n_evals: int | None = 0,
|
|
244
266
|
n_checkpoints: int | None = 1,
|
|
245
267
|
batch_size: int | Literal["max"] = "max",
|
|
246
268
|
learning_rate: float | None = 0.00001,
|
|
269
|
+
lr_scheduler_type: Literal["linear", "cosine"] = "linear",
|
|
247
270
|
min_lr_ratio: float = 0.0,
|
|
271
|
+
scheduler_num_cycles: float = 0.5,
|
|
248
272
|
warmup_ratio: float = 0.0,
|
|
249
273
|
max_grad_norm: float = 1.0,
|
|
250
274
|
weight_decay: float = 0.0,
|
|
@@ -270,7 +294,7 @@ class FineTuning:
|
|
|
270
294
|
|
|
271
295
|
Args:
|
|
272
296
|
training_file (str): File-ID of a file uploaded to the Together API
|
|
273
|
-
model (str): Name of the base model to run fine-tune job on
|
|
297
|
+
model (str, optional): Name of the base model to run fine-tune job on
|
|
274
298
|
n_epochs (int, optional): Number of epochs for fine-tuning. Defaults to 1.
|
|
275
299
|
validation file (str, optional): File ID of a file uploaded to the Together API for validation.
|
|
276
300
|
n_evals (int, optional): Number of evaluation loops to run. Defaults to 0.
|
|
@@ -279,9 +303,11 @@ class FineTuning:
|
|
|
279
303
|
batch_size (int or "max"): Batch size for fine-tuning. Defaults to max.
|
|
280
304
|
learning_rate (float, optional): Learning rate multiplier to use for training
|
|
281
305
|
Defaults to 0.00001.
|
|
306
|
+
lr_scheduler_type (Literal["linear", "cosine"]): Learning rate scheduler type. Defaults to "linear".
|
|
282
307
|
min_lr_ratio (float, optional): Min learning rate ratio of the initial learning rate for
|
|
283
308
|
the learning rate scheduler. Defaults to 0.0.
|
|
284
|
-
|
|
309
|
+
scheduler_num_cycles (float, optional): Number or fraction of cycles for the cosine learning rate scheduler. Defaults to 0.5.
|
|
310
|
+
warmup_ratio (float, optional): Warmup ratio for the learning rate scheduler.
|
|
285
311
|
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0, set to 0 to disable.
|
|
286
312
|
weight_decay (float, optional): Weight decay. Defaults to 0.0.
|
|
287
313
|
lora (bool, optional): Whether to use LoRA adapters. Defaults to True.
|
|
@@ -320,12 +346,24 @@ class FineTuning:
|
|
|
320
346
|
FinetuneResponse: Object containing information about fine-tuning job.
|
|
321
347
|
"""
|
|
322
348
|
|
|
349
|
+
if model is None and from_checkpoint is None:
|
|
350
|
+
raise ValueError("You must specify either a model or a checkpoint")
|
|
351
|
+
|
|
323
352
|
requestor = api_requestor.APIRequestor(
|
|
324
353
|
client=self._client,
|
|
325
354
|
)
|
|
326
355
|
|
|
327
356
|
if model_limits is None:
|
|
328
|
-
|
|
357
|
+
# mypy doesn't understand that model or from_checkpoint is not None
|
|
358
|
+
if model is not None:
|
|
359
|
+
model_name = model
|
|
360
|
+
elif from_checkpoint is not None:
|
|
361
|
+
model_name = from_checkpoint.split(":")[0]
|
|
362
|
+
else:
|
|
363
|
+
# this branch is unreachable, but mypy doesn't know that
|
|
364
|
+
pass
|
|
365
|
+
model_limits = self.get_model_limits(model=model_name)
|
|
366
|
+
|
|
329
367
|
finetune_request = createFinetuneRequest(
|
|
330
368
|
model_limits=model_limits,
|
|
331
369
|
training_file=training_file,
|
|
@@ -336,7 +374,9 @@ class FineTuning:
|
|
|
336
374
|
n_checkpoints=n_checkpoints,
|
|
337
375
|
batch_size=batch_size,
|
|
338
376
|
learning_rate=learning_rate,
|
|
377
|
+
lr_scheduler_type=lr_scheduler_type,
|
|
339
378
|
min_lr_ratio=min_lr_ratio,
|
|
379
|
+
scheduler_num_cycles=scheduler_num_cycles,
|
|
340
380
|
warmup_ratio=warmup_ratio,
|
|
341
381
|
max_grad_norm=max_grad_norm,
|
|
342
382
|
weight_decay=weight_decay,
|
|
@@ -610,14 +650,16 @@ class AsyncFineTuning:
|
|
|
610
650
|
self,
|
|
611
651
|
*,
|
|
612
652
|
training_file: str,
|
|
613
|
-
model: str,
|
|
653
|
+
model: str | None = None,
|
|
614
654
|
n_epochs: int = 1,
|
|
615
655
|
validation_file: str | None = "",
|
|
616
656
|
n_evals: int | None = 0,
|
|
617
657
|
n_checkpoints: int | None = 1,
|
|
618
658
|
batch_size: int | Literal["max"] = "max",
|
|
619
659
|
learning_rate: float | None = 0.00001,
|
|
660
|
+
lr_scheduler_type: Literal["linear", "cosine"] = "linear",
|
|
620
661
|
min_lr_ratio: float = 0.0,
|
|
662
|
+
scheduler_num_cycles: float = 0.5,
|
|
621
663
|
warmup_ratio: float = 0.0,
|
|
622
664
|
max_grad_norm: float = 1.0,
|
|
623
665
|
weight_decay: float = 0.0,
|
|
@@ -643,7 +685,7 @@ class AsyncFineTuning:
|
|
|
643
685
|
|
|
644
686
|
Args:
|
|
645
687
|
training_file (str): File-ID of a file uploaded to the Together API
|
|
646
|
-
model (str): Name of the base model to run fine-tune job on
|
|
688
|
+
model (str, optional): Name of the base model to run fine-tune job on
|
|
647
689
|
n_epochs (int, optional): Number of epochs for fine-tuning. Defaults to 1.
|
|
648
690
|
validation file (str, optional): File ID of a file uploaded to the Together API for validation.
|
|
649
691
|
n_evals (int, optional): Number of evaluation loops to run. Defaults to 0.
|
|
@@ -652,9 +694,11 @@ class AsyncFineTuning:
|
|
|
652
694
|
batch_size (int, optional): Batch size for fine-tuning. Defaults to max.
|
|
653
695
|
learning_rate (float, optional): Learning rate multiplier to use for training
|
|
654
696
|
Defaults to 0.00001.
|
|
697
|
+
lr_scheduler_type (Literal["linear", "cosine"]): Learning rate scheduler type. Defaults to "linear".
|
|
655
698
|
min_lr_ratio (float, optional): Min learning rate ratio of the initial learning rate for
|
|
656
699
|
the learning rate scheduler. Defaults to 0.0.
|
|
657
|
-
|
|
700
|
+
scheduler_num_cycles (float, optional): Number or fraction of cycles for the cosine learning rate scheduler. Defaults to 0.5.
|
|
701
|
+
warmup_ratio (float, optional): Warmup ratio for the learning rate scheduler.
|
|
658
702
|
max_grad_norm (float, optional): Max gradient norm. Defaults to 1.0, set to 0 to disable.
|
|
659
703
|
weight_decay (float, optional): Weight decay. Defaults to 0.0.
|
|
660
704
|
lora (bool, optional): Whether to use LoRA adapters. Defaults to True.
|
|
@@ -693,12 +737,23 @@ class AsyncFineTuning:
|
|
|
693
737
|
FinetuneResponse: Object containing information about fine-tuning job.
|
|
694
738
|
"""
|
|
695
739
|
|
|
740
|
+
if model is None and from_checkpoint is None:
|
|
741
|
+
raise ValueError("You must specify either a model or a checkpoint")
|
|
742
|
+
|
|
696
743
|
requestor = api_requestor.APIRequestor(
|
|
697
744
|
client=self._client,
|
|
698
745
|
)
|
|
699
746
|
|
|
700
747
|
if model_limits is None:
|
|
701
|
-
|
|
748
|
+
# mypy doesn't understand that model or from_checkpoint is not None
|
|
749
|
+
if model is not None:
|
|
750
|
+
model_name = model
|
|
751
|
+
elif from_checkpoint is not None:
|
|
752
|
+
model_name = from_checkpoint.split(":")[0]
|
|
753
|
+
else:
|
|
754
|
+
# this branch is unreachable, but mypy doesn't know that
|
|
755
|
+
pass
|
|
756
|
+
model_limits = await self.get_model_limits(model=model_name)
|
|
702
757
|
|
|
703
758
|
finetune_request = createFinetuneRequest(
|
|
704
759
|
model_limits=model_limits,
|
|
@@ -710,7 +765,9 @@ class AsyncFineTuning:
|
|
|
710
765
|
n_checkpoints=n_checkpoints,
|
|
711
766
|
batch_size=batch_size,
|
|
712
767
|
learning_rate=learning_rate,
|
|
768
|
+
lr_scheduler_type=lr_scheduler_type,
|
|
713
769
|
min_lr_ratio=min_lr_ratio,
|
|
770
|
+
scheduler_num_cycles=scheduler_num_cycles,
|
|
714
771
|
warmup_ratio=warmup_ratio,
|
|
715
772
|
max_grad_norm=max_grad_norm,
|
|
716
773
|
weight_decay=weight_decay,
|
together/types/__init__.py
CHANGED
|
@@ -34,11 +34,14 @@ from together.types.finetune import (
|
|
|
34
34
|
TrainingMethodDPO,
|
|
35
35
|
TrainingMethodSFT,
|
|
36
36
|
FinetuneCheckpoint,
|
|
37
|
+
FinetuneCosineLRScheduler,
|
|
38
|
+
FinetuneCosineLRSchedulerArgs,
|
|
37
39
|
FinetuneDownloadResult,
|
|
40
|
+
FinetuneLinearLRScheduler,
|
|
38
41
|
FinetuneLinearLRSchedulerArgs,
|
|
42
|
+
FinetuneLRScheduler,
|
|
39
43
|
FinetuneList,
|
|
40
44
|
FinetuneListEvents,
|
|
41
|
-
FinetuneLRScheduler,
|
|
42
45
|
FinetuneRequest,
|
|
43
46
|
FinetuneResponse,
|
|
44
47
|
FinetuneTrainingLimits,
|
|
@@ -69,7 +72,10 @@ __all__ = [
|
|
|
69
72
|
"FinetuneListEvents",
|
|
70
73
|
"FinetuneDownloadResult",
|
|
71
74
|
"FinetuneLRScheduler",
|
|
75
|
+
"FinetuneLinearLRScheduler",
|
|
72
76
|
"FinetuneLinearLRSchedulerArgs",
|
|
77
|
+
"FinetuneCosineLRScheduler",
|
|
78
|
+
"FinetuneCosineLRSchedulerArgs",
|
|
73
79
|
"FileRequest",
|
|
74
80
|
"FileResponse",
|
|
75
81
|
"FileList",
|
together/types/finetune.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from typing import List, Literal
|
|
4
|
+
from typing import List, Literal, Union
|
|
5
5
|
|
|
6
|
-
from pydantic import StrictBool, Field, validator, field_validator
|
|
6
|
+
from pydantic import StrictBool, Field, validator, field_validator, ValidationInfo
|
|
7
7
|
|
|
8
8
|
from together.types.abstract import BaseModel
|
|
9
9
|
from together.types.common import (
|
|
@@ -176,7 +176,7 @@ class FinetuneRequest(BaseModel):
|
|
|
176
176
|
# training learning rate
|
|
177
177
|
learning_rate: float
|
|
178
178
|
# learning rate scheduler type and args
|
|
179
|
-
lr_scheduler:
|
|
179
|
+
lr_scheduler: FinetuneLinearLRScheduler | FinetuneCosineLRScheduler | None = None
|
|
180
180
|
# learning rate warmup ratio
|
|
181
181
|
warmup_ratio: float
|
|
182
182
|
# max gradient norm
|
|
@@ -239,7 +239,7 @@ class FinetuneResponse(BaseModel):
|
|
|
239
239
|
# training learning rate
|
|
240
240
|
learning_rate: float | None = None
|
|
241
241
|
# learning rate scheduler type and args
|
|
242
|
-
lr_scheduler:
|
|
242
|
+
lr_scheduler: FinetuneLinearLRScheduler | FinetuneCosineLRScheduler | None = None
|
|
243
243
|
# learning rate warmup ratio
|
|
244
244
|
warmup_ratio: float | None = None
|
|
245
245
|
# max gradient norm
|
|
@@ -345,13 +345,27 @@ class FinetuneTrainingLimits(BaseModel):
|
|
|
345
345
|
lora_training: FinetuneLoraTrainingLimits | None = None
|
|
346
346
|
|
|
347
347
|
|
|
348
|
+
class FinetuneLinearLRSchedulerArgs(BaseModel):
|
|
349
|
+
min_lr_ratio: float | None = 0.0
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
class FinetuneCosineLRSchedulerArgs(BaseModel):
|
|
353
|
+
min_lr_ratio: float | None = 0.0
|
|
354
|
+
num_cycles: float | None = 0.5
|
|
355
|
+
|
|
356
|
+
|
|
348
357
|
class FinetuneLRScheduler(BaseModel):
|
|
349
358
|
lr_scheduler_type: str
|
|
350
|
-
lr_scheduler_args: FinetuneLinearLRSchedulerArgs | None = None
|
|
351
359
|
|
|
352
360
|
|
|
353
|
-
class
|
|
354
|
-
|
|
361
|
+
class FinetuneLinearLRScheduler(FinetuneLRScheduler):
|
|
362
|
+
lr_scheduler_type: Literal["linear"] = "linear"
|
|
363
|
+
lr_scheduler: FinetuneLinearLRSchedulerArgs | None = None
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
class FinetuneCosineLRScheduler(FinetuneLRScheduler):
|
|
367
|
+
lr_scheduler_type: Literal["cosine"] = "cosine"
|
|
368
|
+
lr_scheduler: FinetuneCosineLRSchedulerArgs | None = None
|
|
355
369
|
|
|
356
370
|
|
|
357
371
|
class FinetuneCheckpoint(BaseModel):
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: together
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.2
|
|
4
4
|
Summary: Python client for Together's Cloud Platform!
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Together AI
|
|
7
7
|
Author-email: support@together.ai
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10,<4.0
|
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
10
|
Classifier: Operating System :: POSIX :: Linux
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -45,7 +44,7 @@ Description-Content-Type: text/markdown
|
|
|
45
44
|
[](https://discord.com/invite/9Rk6sSeWEG)
|
|
46
45
|
[](https://twitter.com/togethercompute)
|
|
47
46
|
|
|
48
|
-
The [Together Python API Library](https://pypi.org/project/together/) is the official Python client for Together's API platform, providing a convenient way for interacting with the REST APIs and enables easy integrations with Python 3.
|
|
47
|
+
The [Together Python API Library](https://pypi.org/project/together/) is the official Python client for Together's API platform, providing a convenient way for interacting with the REST APIs and enables easy integrations with Python 3.10+ applications with easy to use synchronous and asynchronous clients.
|
|
49
48
|
|
|
50
49
|
|
|
51
50
|
|
|
@@ -7,7 +7,7 @@ together/cli/api/chat.py,sha256=2PHRb-9T-lUEKhUJFtc7SxJv3shCVx40gq_8pzfsewM,9234
|
|
|
7
7
|
together/cli/api/completions.py,sha256=l-Zw5t7hojL3w8xd_mitS2NRB72i5Z0xwkzH0rT5XMc,4263
|
|
8
8
|
together/cli/api/endpoints.py,sha256=tM42PthzkpTjOkmL6twyWYXqEQw0DOqsEKTZdhp6vKU,13284
|
|
9
9
|
together/cli/api/files.py,sha256=QLYEXRkY8J2Gg1SbTCtzGfoTMvosoeACNK83L_oLubs,3397
|
|
10
|
-
together/cli/api/finetune.py,sha256=
|
|
10
|
+
together/cli/api/finetune.py,sha256=1ks9seHgzIIpjfojz5ZcEnhzTSjPdjpvHST8m6b9HfM,15862
|
|
11
11
|
together/cli/api/images.py,sha256=GADSeaNUHUVMtWovmccGuKc28IJ9E_v4vAEwYHJhu5o,2645
|
|
12
12
|
together/cli/api/models.py,sha256=CXw8B1hqNkadogi58GIXhLg_dTJnvTBaE7Kq1_xQ-10,1423
|
|
13
13
|
together/cli/api/utils.py,sha256=IuqYWPnLI38_Bqd7lj8V_SnGdYc59pRmMbQmciS4FsM,1326
|
|
@@ -33,12 +33,12 @@ together/resources/completions.py,sha256=5Wa-ZjPCxRcam6CDe7KgGYlTA7yJZMmd5TrRgGC
|
|
|
33
33
|
together/resources/embeddings.py,sha256=PTvLb82yjG_-iQOyuhsilp77Fr7gZ0o6WD2KeRnKoxs,2675
|
|
34
34
|
together/resources/endpoints.py,sha256=NNjp-wyzOotzlscGGrANhOHxQBjHTN8f5kTQTH_CLvE,17177
|
|
35
35
|
together/resources/files.py,sha256=bnPbaF25e4InBRPvHwXHXT-oSX1Z1sZRsnQW5wq82U4,4990
|
|
36
|
-
together/resources/finetune.py,sha256=
|
|
36
|
+
together/resources/finetune.py,sha256=XkVdAdCLVeJQly9QU9HsV7YOog6yMygJgS0WFWVWHtE,35825
|
|
37
37
|
together/resources/images.py,sha256=LQUjKPaFxWTqOAPnyF1Pp7Rz4NLOYhmoKwshpYiprEM,4923
|
|
38
38
|
together/resources/models.py,sha256=qgmAXv61Cq4oLxytenEZBywA8shldDHYxJ_EAu_4JWQ,3864
|
|
39
39
|
together/resources/rerank.py,sha256=3Ju_aRSyZ1s_3zCSNZnSnEJErUVmt2xa3M8z1nvejMA,3931
|
|
40
40
|
together/together_response.py,sha256=a3dgKMPDrlfKQwxYENfNt2T4l2vSZxRWMixhHSy-q3E,1308
|
|
41
|
-
together/types/__init__.py,sha256=
|
|
41
|
+
together/types/__init__.py,sha256=PBhPpJklsF5-IiI2aWLK2Srhb36m0v93jR8xv8G7Q_0,2752
|
|
42
42
|
together/types/abstract.py,sha256=1lFQI_3WjsR_t1128AeKW0aTk6EiM6Gh1J3ZuyLLPao,642
|
|
43
43
|
together/types/audio_speech.py,sha256=jlj8BZf3dkIDARF1P11fuenVLj4try8Yx4RN-EAkhOU,2609
|
|
44
44
|
together/types/chat_completions.py,sha256=ggwt1LlBXTB_hZKbtLsjg8j-gXxO8pUUQfTrxUmRXHU,5078
|
|
@@ -48,7 +48,7 @@ together/types/embeddings.py,sha256=J7grkYYn7xhqeKaBO2T-8XQRtHhkzYzymovtGdIUK5A,
|
|
|
48
48
|
together/types/endpoints.py,sha256=EzNhHOoQ_D9fUdNQtxQPeSWiFzdFLqpNodN0YLmv_h0,4393
|
|
49
49
|
together/types/error.py,sha256=OVlCs3cx_2WhZK4JzHT8SQyRIIqKOP1AZQ4y1PydjAE,370
|
|
50
50
|
together/types/files.py,sha256=-rEUfsV6f2vZB9NrFxT4_933ubsDIUNkPB-3OlOFk4A,1954
|
|
51
|
-
together/types/finetune.py,sha256=
|
|
51
|
+
together/types/finetune.py,sha256=RXiqKG4PJuVxd92KlWAvp5ThzTyDrdFTog237XtMplc,10480
|
|
52
52
|
together/types/images.py,sha256=xnC-FZGdZU30WSFTybfGneWxb-kj0ZGufJsgHtB8j0k,980
|
|
53
53
|
together/types/models.py,sha256=nwQIZGHKZpX9I6mK8z56VW70YC6Ry6JGsVa0s99QVxc,1055
|
|
54
54
|
together/types/rerank.py,sha256=qZfuXOn7MZ6ly8hpJ_MZ7OU_Bi1-cgYNSB20Wja8Qkk,1061
|
|
@@ -58,8 +58,8 @@ together/utils/api_helpers.py,sha256=2K0O6qeEQ2zVFvi5NBN5m2kjZJaS3-JfKFecQ7SmGaw
|
|
|
58
58
|
together/utils/files.py,sha256=rfp10qU0urtWOXXFeasFtO9xp-1KIhM3S43JxcnHmL0,16438
|
|
59
59
|
together/utils/tools.py,sha256=H2MTJhEqtBllaDvOyZehIO_IVNK3P17rSDeILtJIVag,2964
|
|
60
60
|
together/version.py,sha256=p03ivHyE0SyWU4jAnRTBi_sOwywVWoZPU4g2gzRgG-Y,126
|
|
61
|
-
together-1.
|
|
62
|
-
together-1.
|
|
63
|
-
together-1.
|
|
64
|
-
together-1.
|
|
65
|
-
together-1.
|
|
61
|
+
together-1.5.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
62
|
+
together-1.5.2.dist-info/METADATA,sha256=jfmcsEpyK2V59GcIC3hZ807WXYbMvcs-mLrd1nz1sfg,14397
|
|
63
|
+
together-1.5.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
64
|
+
together-1.5.2.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
|
|
65
|
+
together-1.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|