together 1.5.23__py3-none-any.whl → 1.5.25__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,20 @@ 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
+ "--from-hf-model",
205
+ type=str,
206
+ help="The Hugging Face Hub repo to start training from. "
207
+ "Should be as close as possible to the base model (specified by the `model` argument) "
208
+ "in terms of architecture and size",
209
+ )
210
+ @click.option(
211
+ "--hf-model-revision",
212
+ type=str,
213
+ help="The revision of the Hugging Face Hub model to continue training from. "
214
+ "Example: hf_model_revision=None (defaults to the latest revision in `main`) "
215
+ "or hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).",
216
+ )
203
217
  @click.option(
204
218
  "--hf-api-token",
205
219
  type=str,
@@ -246,6 +260,8 @@ def create(
246
260
  rpo_alpha: float | None,
247
261
  simpo_gamma: float | None,
248
262
  from_checkpoint: str,
263
+ from_hf_model: str,
264
+ hf_model_revision: str,
249
265
  hf_api_token: str | None,
250
266
  hf_output_repo_name: str | None,
251
267
  ) -> None:
@@ -284,6 +300,8 @@ def create(
284
300
  rpo_alpha=rpo_alpha,
285
301
  simpo_gamma=simpo_gamma,
286
302
  from_checkpoint=from_checkpoint,
303
+ from_hf_model=from_hf_model,
304
+ hf_model_revision=hf_model_revision,
287
305
  hf_api_token=hf_api_token,
288
306
  hf_output_repo_name=hf_output_repo_name,
289
307
  )
@@ -72,6 +72,21 @@ class Batches:
72
72
  jobs = response.data or []
73
73
  return [BatchJob(**job) for job in jobs]
74
74
 
75
+ def cancel_batch(self, batch_job_id: str) -> BatchJob:
76
+ requestor = api_requestor.APIRequestor(
77
+ client=self._client,
78
+ )
79
+
80
+ response, _, _ = requestor.request(
81
+ options=TogetherRequest(
82
+ method="POST",
83
+ url=f"batches/{batch_job_id}/cancel",
84
+ ),
85
+ stream=False,
86
+ )
87
+
88
+ return BatchJob(**response.data)
89
+
75
90
 
76
91
  class AsyncBatches:
77
92
  def __init__(self, client: TogetherClient) -> None:
@@ -133,3 +148,18 @@ class AsyncBatches:
133
148
  assert isinstance(response, TogetherResponse)
134
149
  jobs = response.data or []
135
150
  return [BatchJob(**job) for job in jobs]
151
+
152
+ async def cancel_batch(self, batch_job_id: str) -> BatchJob:
153
+ requestor = api_requestor.APIRequestor(
154
+ client=self._client,
155
+ )
156
+
157
+ response, _, _ = await requestor.arequest(
158
+ options=TogetherRequest(
159
+ method="POST",
160
+ url=f"batches/{batch_job_id}/cancel",
161
+ ),
162
+ stream=False,
163
+ )
164
+
165
+ return BatchJob(**response.data)
@@ -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
+ from_hf_model: str | None = None,
80
+ hf_model_revision: str | None = None,
79
81
  hf_api_token: str | None = None,
80
82
  hf_output_repo_name: str | None = None,
81
83
  ) -> FinetuneRequest:
@@ -87,6 +89,17 @@ def create_finetune_request(
87
89
  if model is None and from_checkpoint is None:
88
90
  raise ValueError("You must specify either a model or a checkpoint")
89
91
 
92
+ if from_checkpoint is not None and from_hf_model is not None:
93
+ raise ValueError(
94
+ "You must specify either a Hugging Face Hub model or a previous checkpoint from "
95
+ "Together to start a job from, not both"
96
+ )
97
+
98
+ if from_hf_model is not None and model is None:
99
+ raise ValueError(
100
+ "You must specify the base model to fine-tune a model from the Hugging Face Hub"
101
+ )
102
+
90
103
  model_or_checkpoint = model or from_checkpoint
91
104
 
92
105
  if warmup_ratio is None:
@@ -251,6 +264,8 @@ def create_finetune_request(
251
264
  wandb_name=wandb_name,
252
265
  training_method=training_method_cls,
253
266
  from_checkpoint=from_checkpoint,
267
+ from_hf_model=from_hf_model,
268
+ hf_model_revision=hf_model_revision,
254
269
  hf_api_token=hf_api_token,
255
270
  hf_output_repo_name=hf_output_repo_name,
256
271
  )
@@ -332,6 +347,8 @@ class FineTuning:
332
347
  rpo_alpha: float | None = None,
333
348
  simpo_gamma: float | None = None,
334
349
  from_checkpoint: str | None = None,
350
+ from_hf_model: str | None = None,
351
+ hf_model_revision: str | None = None,
335
352
  hf_api_token: str | None = None,
336
353
  hf_output_repo_name: str | None = None,
337
354
  ) -> FinetuneResponse:
@@ -390,6 +407,11 @@ class FineTuning:
390
407
  from_checkpoint (str, optional): The checkpoint identifier to continue training from a previous fine-tuning job.
391
408
  The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
392
409
  The step value is optional, without it the final checkpoint will be used.
410
+ from_hf_model (str, optional): The Hugging Face Hub repo to start training from.
411
+ Should be as close as possible to the base model (specified by the `model` argument) in terms of architecture and size.
412
+ hf_model_revision (str, optional): The revision of the Hugging Face Hub model to continue training from. Defaults to None.
413
+ Example: hf_model_revision=None (defaults to the latest revision in `main`) or
414
+ hf_model_revision="607a30d783dfa663caf39e06633721c8d4cfcd7e" (specific commit).
393
415
  hf_api_token (str, optional): API key for the Hugging Face Hub. Defaults to None.
394
416
  hf_output_repo_name (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
395
417
 
@@ -445,6 +467,8 @@ class FineTuning:
445
467
  rpo_alpha=rpo_alpha,
446
468
  simpo_gamma=simpo_gamma,
447
469
  from_checkpoint=from_checkpoint,
470
+ from_hf_model=from_hf_model,
471
+ hf_model_revision=hf_model_revision,
448
472
  hf_api_token=hf_api_token,
449
473
  hf_output_repo_name=hf_output_repo_name,
450
474
  )
@@ -759,6 +783,8 @@ class AsyncFineTuning:
759
783
  rpo_alpha: float | None = None,
760
784
  simpo_gamma: float | None = None,
761
785
  from_checkpoint: str | None = None,
786
+ from_hf_model: str | None = None,
787
+ hf_model_revision: str | None = None,
762
788
  hf_api_token: str | None = None,
763
789
  hf_output_repo_name: str | None = None,
764
790
  ) -> FinetuneResponse:
@@ -817,6 +843,11 @@ class AsyncFineTuning:
817
843
  from_checkpoint (str, optional): The checkpoint identifier to continue training from a previous fine-tuning job.
818
844
  The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
819
845
  The step value is optional, without it the final checkpoint will be used.
846
+ from_hf_model (str, optional): The Hugging Face Hub repo to start training from.
847
+ Should be as close as possible to the base model (specified by the `model` argument) in terms of architecture and size.
848
+ hf_model_revision (str, optional): The revision of the Hugging Face Hub model to continue training from. Defaults to None.
849
+ Example: hf_model_revision=None (defaults to the latest revision in `main`) or
850
+ hf_model_revision="607a30d783dfa663caf39e06633721c8d4cfcd7e" (specific commit).
820
851
  hf_api_token (str, optional): API key for the Huggging Face Hub. Defaults to None.
821
852
  hf_output_repo_name (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
822
853
 
@@ -872,6 +903,8 @@ class AsyncFineTuning:
872
903
  rpo_alpha=rpo_alpha,
873
904
  simpo_gamma=simpo_gamma,
874
905
  from_checkpoint=from_checkpoint,
906
+ from_hf_model=from_hf_model,
907
+ hf_model_revision=hf_model_revision,
875
908
  hf_api_token=hf_api_token,
876
909
  hf_output_repo_name=hf_output_repo_name,
877
910
  )
together/types/batch.py CHANGED
@@ -20,6 +20,7 @@ class BatchJobStatus(str, Enum):
20
20
  FAILED = "FAILED"
21
21
  EXPIRED = "EXPIRED"
22
22
  CANCELLED = "CANCELLED"
23
+ CANCELING = "CANCELING"
23
24
 
24
25
 
25
26
  class BatchEndpoint(str, Enum):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 1.5.23
3
+ Version: 1.5.25
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  License: Apache-2.0
6
6
  Author: Together AI
@@ -8,7 +8,7 @@ together/cli/api/completions.py,sha256=l-Zw5t7hojL3w8xd_mitS2NRB72i5Z0xwkzH0rT5X
8
8
  together/cli/api/endpoints.py,sha256=f6KafWZvRF6n_ThWdr3y9uhE6wPF37PcD45w_EtgXmY,13289
9
9
  together/cli/api/evaluation.py,sha256=reu8LRUDqDBf9mCwbbD_kETyB4PdokvA5mc792iIrSU,11367
10
10
  together/cli/api/files.py,sha256=QLYEXRkY8J2Gg1SbTCtzGfoTMvosoeACNK83L_oLubs,3397
11
- together/cli/api/finetune.py,sha256=bXvkI1oxaEHOKlzHFzdTQv6G39qX22lZ8L4IRpJ5uZU,16832
11
+ together/cli/api/finetune.py,sha256=MxNaxz-lbXwv2b2kcIxII3hfSf_49w39jUUieh9Mb34,17528
12
12
  together/cli/api/images.py,sha256=GADSeaNUHUVMtWovmccGuKc28IJ9E_v4vAEwYHJhu5o,2645
13
13
  together/cli/api/models.py,sha256=CXw8B1hqNkadogi58GIXhLg_dTJnvTBaE7Kq1_xQ-10,1423
14
14
  together/cli/api/utils.py,sha256=IuqYWPnLI38_Bqd7lj8V_SnGdYc59pRmMbQmciS4FsM,1326
@@ -30,7 +30,7 @@ together/resources/audio/__init__.py,sha256=S6gV6aEPAHL9kskoA38Uq_Ju7uM1Xcfl0doO
30
30
  together/resources/audio/speech.py,sha256=81ib_gIo-Rxoaipx2Pi9ZsKnOTjeFPwSlBrcUkyX5xk,5211
31
31
  together/resources/audio/transcriptions.py,sha256=67TPiDzfEcsHMpRyZx8eGR5jtnmEcZNUjA6g3Ykq4Zg,10219
32
32
  together/resources/audio/translations.py,sha256=_2VeYEthYzPIflDD_hlVmoXk-OCgLgnvva2vMPpaU_Q,10508
33
- together/resources/batch.py,sha256=tYd8UsfBrVWmdw0nHc2TiYhtXosNkeYBb9Hruze-71A,3749
33
+ together/resources/batch.py,sha256=dBXgh264AQPsO3pCff1vT1PAewnX9yroxa8UZQUJAqE,4584
34
34
  together/resources/chat/__init__.py,sha256=RsTptdP8MeGjcdIjze896-J27cRvCbUoMft0X2BVlQ8,617
35
35
  together/resources/chat/completions.py,sha256=cBsSFWi9qToQCn4V_3qJ0gwRqORjF6NFDXmHcHfIhOY,14442
36
36
  together/resources/code_interpreter.py,sha256=vbN8Mh5MG6HQvqra7p61leIyfebgbgJTM_q2A_Fylhw,2948
@@ -39,7 +39,7 @@ together/resources/embeddings.py,sha256=PTvLb82yjG_-iQOyuhsilp77Fr7gZ0o6WD2KeRnK
39
39
  together/resources/endpoints.py,sha256=NNjp-wyzOotzlscGGrANhOHxQBjHTN8f5kTQTH_CLvE,17177
40
40
  together/resources/evaluation.py,sha256=YjHCT9JZ30ENuSJ16WZRLPtB1qEIo2aXt8ggK06M1XY,26987
41
41
  together/resources/files.py,sha256=y3Ri6UtyAa7fjCJ8_fp26Y2hzzi6Aoo21JKkVgljFl8,5026
42
- together/resources/finetune.py,sha256=jrvd3CYlu5AWeyujuwz5YkAey6mNg_aV6HPXkKP1OtY,40979
42
+ together/resources/finetune.py,sha256=PAvQYunCwg-0R9ItirZheF-F0YnZctTrH3so8iZzGf4,43039
43
43
  together/resources/images.py,sha256=LQUjKPaFxWTqOAPnyF1Pp7Rz4NLOYhmoKwshpYiprEM,4923
44
44
  together/resources/models.py,sha256=qgmAXv61Cq4oLxytenEZBywA8shldDHYxJ_EAu_4JWQ,3864
45
45
  together/resources/rerank.py,sha256=3Ju_aRSyZ1s_3zCSNZnSnEJErUVmt2xa3M8z1nvejMA,3931
@@ -47,7 +47,7 @@ together/together_response.py,sha256=a3dgKMPDrlfKQwxYENfNt2T4l2vSZxRWMixhHSy-q3E
47
47
  together/types/__init__.py,sha256=qSGo1AWLB0v7L_y1Fl1FQ_Cen48UmRs0Rc-EEQOjj_A,3942
48
48
  together/types/abstract.py,sha256=1lFQI_3WjsR_t1128AeKW0aTk6EiM6Gh1J3ZuyLLPao,642
49
49
  together/types/audio_speech.py,sha256=7GNldCfddDNo1vVPqyT-u7fX_TR-du1OePSzoXdAK3s,4694
50
- together/types/batch.py,sha256=FP0RuQ3EDy-FV1bh-biPICvyRS7WqLm38GHz5lzKyXM,1112
50
+ together/types/batch.py,sha256=KiI5i1En7cyIUxHhVIGoQk6Wlw19c0PXSqDWwc2KZ2c,1140
51
51
  together/types/chat_completions.py,sha256=NxJ7tFlWynxoLsRtQHzM7Ka3QxKVjRs6EvtOTYZ79bM,5340
52
52
  together/types/code_interpreter.py,sha256=cjF8TKgRkJllHS4i24dWQZBGTRsG557eHSewOiip0Kk,1770
53
53
  together/types/common.py,sha256=kxZ-N9xtBsGYZBmbIWnZ0rfT3Pn8PFB7sAbp3iv96pw,1525
@@ -67,8 +67,8 @@ together/utils/api_helpers.py,sha256=2K0O6qeEQ2zVFvi5NBN5m2kjZJaS3-JfKFecQ7SmGaw
67
67
  together/utils/files.py,sha256=CTngpKf_Erp31fbT0dQFtKXrABcsKUpSX1_EGQTgFno,20682
68
68
  together/utils/tools.py,sha256=H2MTJhEqtBllaDvOyZehIO_IVNK3P17rSDeILtJIVag,2964
69
69
  together/version.py,sha256=p03ivHyE0SyWU4jAnRTBi_sOwywVWoZPU4g2gzRgG-Y,126
70
- together-1.5.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
- together-1.5.23.dist-info/METADATA,sha256=w8bOKW50Jw3KXqgT31YKKRaO8uaeW7hvXAs7WYX8Vtg,16441
72
- together-1.5.23.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
73
- together-1.5.23.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
74
- together-1.5.23.dist-info/RECORD,,
70
+ together-1.5.25.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
71
+ together-1.5.25.dist-info/METADATA,sha256=zq3CIGBZGKZ9EPXGoF5z5kh8kcaQHrH9_RJvTeyTA1g,16441
72
+ together-1.5.25.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
73
+ together-1.5.25.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
74
+ together-1.5.25.dist-info/RECORD,,