together 1.5.17__py3-none-any.whl → 1.5.19__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.
@@ -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, str | Dict[str, Any]] | None = None,
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
- return {"schema": self.schema_, "type": self.type}
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):
@@ -67,6 +67,8 @@ class FinetuneEventType(str, Enum):
67
67
  MODEL_COMPRESSION_COMPLETE = "MODEL_COMPRESSION_COMPLETE"
68
68
  MODEL_UPLOADING = "MODEL_UPLOADING"
69
69
  MODEL_UPLOAD_COMPLETE = "MODEL_UPLOAD_COMPLETE"
70
+ MODEL_UPLOADING_TO_HF = "MODEL_UPLOADING_TO_HF"
71
+ MODEL_UPLOAD_TO_HF_COMPLETE = "MODEL_UPLOAD_TO_HF_COMPLETE"
70
72
  JOB_COMPLETE = "JOB_COMPLETE"
71
73
  JOB_ERROR = "JOB_ERROR"
72
74
  JOB_USER_ERROR = "JOB_USER_ERROR"
@@ -212,6 +214,9 @@ class FinetuneRequest(BaseModel):
212
214
  )
213
215
  # from step
214
216
  from_checkpoint: str | None = None
217
+ # hf related fields
218
+ hf_api_token: str | None = None
219
+ hf_output_repo_name: str | None = None
215
220
 
216
221
 
217
222
  class FinetuneResponse(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 1.5.17
3
+ Version: 1.5.19
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  License: Apache-2.0
6
6
  Author: Together AI
@@ -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=f6KafWZvRF6n_ThWdr3y9uhE6wPF37PcD45w_EtgXmY,13289
9
9
  together/cli/api/files.py,sha256=QLYEXRkY8J2Gg1SbTCtzGfoTMvosoeACNK83L_oLubs,3397
10
- together/cli/api/finetune.py,sha256=GyG_syK_ctzSnXgO6RgQy4tHbPtAaB9j-mQmnWJq5cg,17085
10
+ together/cli/api/finetune.py,sha256=vIAvHQ8K6AxqJn2aqxd2ZPb1ZicLeb509_LpD4A9Thw,17517
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
@@ -29,13 +29,13 @@ together/resources/audio/__init__.py,sha256=e7xp0Lkp_nMAHXcuFHS7dLXP_YqTPMMZIilW
29
29
  together/resources/audio/speech.py,sha256=81ib_gIo-Rxoaipx2Pi9ZsKnOTjeFPwSlBrcUkyX5xk,5211
30
30
  together/resources/batch.py,sha256=wSJR30CAFjzZ436vjYdXLCT0ahA5E0ud_qHMS5YvZ1M,3750
31
31
  together/resources/chat/__init__.py,sha256=RsTptdP8MeGjcdIjze896-J27cRvCbUoMft0X2BVlQ8,617
32
- together/resources/chat/completions.py,sha256=jYiNZsWa8RyEacL0VgxWj1egJ857oU4nxIY8uqGHcaU,14459
32
+ together/resources/chat/completions.py,sha256=cBsSFWi9qToQCn4V_3qJ0gwRqORjF6NFDXmHcHfIhOY,14442
33
33
  together/resources/code_interpreter.py,sha256=vbN8Mh5MG6HQvqra7p61leIyfebgbgJTM_q2A_Fylhw,2948
34
34
  together/resources/completions.py,sha256=5Wa-ZjPCxRcam6CDe7KgGYlTA7yJZMmd5TrRgGCL_ug,11726
35
35
  together/resources/embeddings.py,sha256=PTvLb82yjG_-iQOyuhsilp77Fr7gZ0o6WD2KeRnKoxs,2675
36
36
  together/resources/endpoints.py,sha256=NNjp-wyzOotzlscGGrANhOHxQBjHTN8f5kTQTH_CLvE,17177
37
37
  together/resources/files.py,sha256=y3Ri6UtyAa7fjCJ8_fp26Y2hzzi6Aoo21JKkVgljFl8,5026
38
- together/resources/finetune.py,sha256=1O8JIbtLDY32N6hL88jUQVDEGcXFnl9qJAEREFoEK5k,40407
38
+ together/resources/finetune.py,sha256=IFevk_AwCr9D2f4LssKEFP9OEDbHSuFA5CZMusDHajc,41343
39
39
  together/resources/images.py,sha256=LQUjKPaFxWTqOAPnyF1Pp7Rz4NLOYhmoKwshpYiprEM,4923
40
40
  together/resources/models.py,sha256=qgmAXv61Cq4oLxytenEZBywA8shldDHYxJ_EAu_4JWQ,3864
41
41
  together/resources/rerank.py,sha256=3Ju_aRSyZ1s_3zCSNZnSnEJErUVmt2xa3M8z1nvejMA,3931
@@ -44,7 +44,7 @@ together/types/__init__.py,sha256=_93XstLg1OOWratj_N1bsNN-2aS628uHH3SZj0wszyc,28
44
44
  together/types/abstract.py,sha256=1lFQI_3WjsR_t1128AeKW0aTk6EiM6Gh1J3ZuyLLPao,642
45
45
  together/types/audio_speech.py,sha256=jlj8BZf3dkIDARF1P11fuenVLj4try8Yx4RN-EAkhOU,2609
46
46
  together/types/batch.py,sha256=FP0RuQ3EDy-FV1bh-biPICvyRS7WqLm38GHz5lzKyXM,1112
47
- together/types/chat_completions.py,sha256=qpBCMXEWtRwW_fmiu6cecm3d4h6mcK8gvr-8JkbAopQ,5104
47
+ together/types/chat_completions.py,sha256=NxJ7tFlWynxoLsRtQHzM7Ka3QxKVjRs6EvtOTYZ79bM,5340
48
48
  together/types/code_interpreter.py,sha256=cjF8TKgRkJllHS4i24dWQZBGTRsG557eHSewOiip0Kk,1770
49
49
  together/types/common.py,sha256=kxZ-N9xtBsGYZBmbIWnZ0rfT3Pn8PFB7sAbp3iv96pw,1525
50
50
  together/types/completions.py,sha256=o3FR5ixsTUj-a3pmOUzbSQg-hESVhpqrC9UD__VCqr4,2971
@@ -52,7 +52,7 @@ together/types/embeddings.py,sha256=J7grkYYn7xhqeKaBO2T-8XQRtHhkzYzymovtGdIUK5A,
52
52
  together/types/endpoints.py,sha256=EzNhHOoQ_D9fUdNQtxQPeSWiFzdFLqpNodN0YLmv_h0,4393
53
53
  together/types/error.py,sha256=OVlCs3cx_2WhZK4JzHT8SQyRIIqKOP1AZQ4y1PydjAE,370
54
54
  together/types/files.py,sha256=i-Ke57p8Svb1MbMZxu-Fo2zxIc6j-mDO2TLGNwPpGu0,1981
55
- together/types/finetune.py,sha256=6_jXgVVp4OOQXkABh0HKBzGy47H3wYCG2QxtXbdYauw,11079
55
+ together/types/finetune.py,sha256=doSbh_zS_W-tcfu4K-yq_wcdHbvkQwHDpYSKfGVphik,11298
56
56
  together/types/images.py,sha256=xnC-FZGdZU30WSFTybfGneWxb-kj0ZGufJsgHtB8j0k,980
57
57
  together/types/models.py,sha256=nwQIZGHKZpX9I6mK8z56VW70YC6Ry6JGsVa0s99QVxc,1055
58
58
  together/types/rerank.py,sha256=qZfuXOn7MZ6ly8hpJ_MZ7OU_Bi1-cgYNSB20Wja8Qkk,1061
@@ -62,8 +62,8 @@ together/utils/api_helpers.py,sha256=2K0O6qeEQ2zVFvi5NBN5m2kjZJaS3-JfKFecQ7SmGaw
62
62
  together/utils/files.py,sha256=btWQawwXbNKfPmCtRyObZViG1Xx-IPz45PrAtMXvcy8,16741
63
63
  together/utils/tools.py,sha256=H2MTJhEqtBllaDvOyZehIO_IVNK3P17rSDeILtJIVag,2964
64
64
  together/version.py,sha256=p03ivHyE0SyWU4jAnRTBi_sOwywVWoZPU4g2gzRgG-Y,126
65
- together-1.5.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
- together-1.5.17.dist-info/METADATA,sha256=b_DHVFaWDUPFcPHSminvXGJ3THG4CLZTwXqR8OpW9aY,15497
67
- together-1.5.17.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
68
- together-1.5.17.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
69
- together-1.5.17.dist-info/RECORD,,
65
+ together-1.5.19.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
66
+ together-1.5.19.dist-info/METADATA,sha256=OOwcpWDhwS6JZpmklE3GLEQiN_UzoicKxuCA_nxYp4w,15497
67
+ together-1.5.19.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
68
+ together-1.5.19.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
69
+ together-1.5.19.dist-info/RECORD,,