together 1.5.17__tar.gz → 1.5.18__tar.gz
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-1.5.17 → together-1.5.18}/PKG-INFO +1 -1
- {together-1.5.17 → together-1.5.18}/pyproject.toml +1 -1
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/finetune.py +17 -1
- {together-1.5.17 → together-1.5.18}/src/together/resources/chat/completions.py +1 -1
- {together-1.5.17 → together-1.5.18}/src/together/resources/finetune.py +16 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/chat_completions.py +8 -1
- {together-1.5.17 → together-1.5.18}/src/together/types/finetune.py +3 -0
- {together-1.5.17 → together-1.5.18}/LICENSE +0 -0
- {together-1.5.17 → together-1.5.18}/README.md +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/abstract/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/abstract/api_requestor.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/chat.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/completions.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/endpoints.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/files.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/images.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/models.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/api/utils.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/cli/cli.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/client.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/constants.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/error.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/filemanager.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/base.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/complete.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/embeddings.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/files.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/finetune.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/images.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/legacy/models.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/audio/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/audio/speech.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/batch.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/chat/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/code_interpreter.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/completions.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/embeddings.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/endpoints.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/files.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/images.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/models.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/resources/rerank.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/together_response.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/abstract.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/audio_speech.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/batch.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/code_interpreter.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/common.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/completions.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/embeddings.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/endpoints.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/error.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/files.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/images.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/models.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/types/rerank.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/utils/__init__.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/utils/_log.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/utils/api_helpers.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/utils/files.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/utils/tools.py +0 -0
- {together-1.5.17 → together-1.5.18}/src/together/version.py +0 -0
|
@@ -12,7 +12,7 @@ build-backend = "poetry.masonry.api"
|
|
|
12
12
|
|
|
13
13
|
[tool.poetry]
|
|
14
14
|
name = "together"
|
|
15
|
-
version = "1.5.
|
|
15
|
+
version = "1.5.18"
|
|
16
16
|
authors = ["Together AI <support@together.ai>"]
|
|
17
17
|
description = "Python client for Together's Cloud Platform!"
|
|
18
18
|
readme = "README.md"
|
|
@@ -200,6 +200,18 @@ def fine_tuning(ctx: click.Context) -> None:
|
|
|
200
200
|
"The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}. "
|
|
201
201
|
"The step value is optional, without it the final checkpoint will be used.",
|
|
202
202
|
)
|
|
203
|
+
@click.option(
|
|
204
|
+
"--hf-api-token",
|
|
205
|
+
type=str,
|
|
206
|
+
default=None,
|
|
207
|
+
help="HF API token to use for uploading a checkpoint to a private repo",
|
|
208
|
+
)
|
|
209
|
+
@click.option(
|
|
210
|
+
"--hf-output-repo-name",
|
|
211
|
+
type=str,
|
|
212
|
+
default=None,
|
|
213
|
+
help="HF repo to upload the fine-tuned model to",
|
|
214
|
+
)
|
|
203
215
|
def create(
|
|
204
216
|
ctx: click.Context,
|
|
205
217
|
training_file: str,
|
|
@@ -234,6 +246,8 @@ def create(
|
|
|
234
246
|
rpo_alpha: float | None,
|
|
235
247
|
simpo_gamma: float | None,
|
|
236
248
|
from_checkpoint: str,
|
|
249
|
+
hf_api_token: str | None,
|
|
250
|
+
hf_output_repo_name: str | None,
|
|
237
251
|
) -> None:
|
|
238
252
|
"""Start fine-tuning"""
|
|
239
253
|
client: Together = ctx.obj
|
|
@@ -270,6 +284,8 @@ def create(
|
|
|
270
284
|
rpo_alpha=rpo_alpha,
|
|
271
285
|
simpo_gamma=simpo_gamma,
|
|
272
286
|
from_checkpoint=from_checkpoint,
|
|
287
|
+
hf_api_token=hf_api_token,
|
|
288
|
+
hf_output_repo_name=hf_output_repo_name,
|
|
273
289
|
)
|
|
274
290
|
|
|
275
291
|
if model is None and from_checkpoint is None:
|
|
@@ -280,7 +296,7 @@ def create(
|
|
|
280
296
|
model_name = from_checkpoint.split(":")[0]
|
|
281
297
|
|
|
282
298
|
model_limits: FinetuneTrainingLimits = client.fine_tuning.get_model_limits(
|
|
283
|
-
model=model_name
|
|
299
|
+
model=model_name,
|
|
284
300
|
)
|
|
285
301
|
|
|
286
302
|
if lora:
|
|
@@ -38,7 +38,7 @@ class ChatCompletions:
|
|
|
38
38
|
echo: bool | None = None,
|
|
39
39
|
n: int | None = None,
|
|
40
40
|
safety_model: str | None = None,
|
|
41
|
-
response_format: Dict[str,
|
|
41
|
+
response_format: Dict[str, Any] | None = None,
|
|
42
42
|
tools: List[Dict[str, Any]] | None = None,
|
|
43
43
|
tool_choice: str | Dict[str, str | Dict[str, str]] | None = None,
|
|
44
44
|
**kwargs: Any,
|
|
@@ -76,6 +76,8 @@ def create_finetune_request(
|
|
|
76
76
|
rpo_alpha: float | None = None,
|
|
77
77
|
simpo_gamma: float | None = None,
|
|
78
78
|
from_checkpoint: str | None = None,
|
|
79
|
+
hf_api_token: str | None = None,
|
|
80
|
+
hf_output_repo_name: str | None = None,
|
|
79
81
|
) -> FinetuneRequest:
|
|
80
82
|
if model is not None and from_checkpoint is not None:
|
|
81
83
|
raise ValueError(
|
|
@@ -262,6 +264,8 @@ def create_finetune_request(
|
|
|
262
264
|
wandb_name=wandb_name,
|
|
263
265
|
training_method=training_method_cls,
|
|
264
266
|
from_checkpoint=from_checkpoint,
|
|
267
|
+
hf_api_token=hf_api_token,
|
|
268
|
+
hf_output_repo_name=hf_output_repo_name,
|
|
265
269
|
)
|
|
266
270
|
|
|
267
271
|
return finetune_request
|
|
@@ -341,6 +345,8 @@ class FineTuning:
|
|
|
341
345
|
rpo_alpha: float | None = None,
|
|
342
346
|
simpo_gamma: float | None = None,
|
|
343
347
|
from_checkpoint: str | None = None,
|
|
348
|
+
hf_api_token: str | None = None,
|
|
349
|
+
hf_output_repo_name: str | None = None,
|
|
344
350
|
) -> FinetuneResponse:
|
|
345
351
|
"""
|
|
346
352
|
Method to initiate a fine-tuning job
|
|
@@ -397,6 +403,8 @@ class FineTuning:
|
|
|
397
403
|
from_checkpoint (str, optional): The checkpoint identifier to continue training from a previous fine-tuning job.
|
|
398
404
|
The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
|
|
399
405
|
The step value is optional, without it the final checkpoint will be used.
|
|
406
|
+
hf_api_token (str, optional): API key for the Hugging Face Hub. Defaults to None.
|
|
407
|
+
hf_output_repo_name (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
|
|
400
408
|
|
|
401
409
|
Returns:
|
|
402
410
|
FinetuneResponse: Object containing information about fine-tuning job.
|
|
@@ -450,6 +458,8 @@ class FineTuning:
|
|
|
450
458
|
rpo_alpha=rpo_alpha,
|
|
451
459
|
simpo_gamma=simpo_gamma,
|
|
452
460
|
from_checkpoint=from_checkpoint,
|
|
461
|
+
hf_api_token=hf_api_token,
|
|
462
|
+
hf_output_repo_name=hf_output_repo_name,
|
|
453
463
|
)
|
|
454
464
|
|
|
455
465
|
if verbose:
|
|
@@ -762,6 +772,8 @@ class AsyncFineTuning:
|
|
|
762
772
|
rpo_alpha: float | None = None,
|
|
763
773
|
simpo_gamma: float | None = None,
|
|
764
774
|
from_checkpoint: str | None = None,
|
|
775
|
+
hf_api_token: str | None = None,
|
|
776
|
+
hf_output_repo_name: str | None = None,
|
|
765
777
|
) -> FinetuneResponse:
|
|
766
778
|
"""
|
|
767
779
|
Async method to initiate a fine-tuning job
|
|
@@ -818,6 +830,8 @@ class AsyncFineTuning:
|
|
|
818
830
|
from_checkpoint (str, optional): The checkpoint identifier to continue training from a previous fine-tuning job.
|
|
819
831
|
The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
|
|
820
832
|
The step value is optional, without it the final checkpoint will be used.
|
|
833
|
+
hf_api_token (str, optional): API key for the Huggging Face Hub. Defaults to None.
|
|
834
|
+
hf_output_repo_name (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
|
|
821
835
|
|
|
822
836
|
Returns:
|
|
823
837
|
FinetuneResponse: Object containing information about fine-tuning job.
|
|
@@ -871,6 +885,8 @@ class AsyncFineTuning:
|
|
|
871
885
|
rpo_alpha=rpo_alpha,
|
|
872
886
|
simpo_gamma=simpo_gamma,
|
|
873
887
|
from_checkpoint=from_checkpoint,
|
|
888
|
+
hf_api_token=hf_api_token,
|
|
889
|
+
hf_output_repo_name=hf_output_repo_name,
|
|
874
890
|
)
|
|
875
891
|
|
|
876
892
|
if verbose:
|
|
@@ -28,6 +28,7 @@ class MessageRole(str, Enum):
|
|
|
28
28
|
class ResponseFormatType(str, Enum):
|
|
29
29
|
JSON_OBJECT = "json_object"
|
|
30
30
|
JSON_SCHEMA = "json_schema"
|
|
31
|
+
REGEX = "regex"
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
class FunctionCall(BaseModel):
|
|
@@ -71,9 +72,15 @@ class ChatCompletionMessage(BaseModel):
|
|
|
71
72
|
class ResponseFormat(BaseModel):
|
|
72
73
|
type: ResponseFormatType
|
|
73
74
|
schema_: Dict[str, Any] | None = None
|
|
75
|
+
pattern: str | None = None
|
|
74
76
|
|
|
75
77
|
def to_dict(self) -> Dict[str, Any]:
|
|
76
|
-
|
|
78
|
+
result: Dict[str, Any] = {"type": self.type.value}
|
|
79
|
+
if self.schema_ is not None:
|
|
80
|
+
result["schema"] = self.schema_
|
|
81
|
+
if self.pattern is not None:
|
|
82
|
+
result["pattern"] = self.pattern
|
|
83
|
+
return result
|
|
77
84
|
|
|
78
85
|
|
|
79
86
|
class FunctionTool(BaseModel):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|