together 1.5.2__py3-none-any.whl → 1.5.3__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.
@@ -87,6 +87,9 @@ def createFinetuneRequest(
87
87
  "You must specify either a model or a checkpoint to start a job from, not both"
88
88
  )
89
89
 
90
+ if model is None and from_checkpoint is None:
91
+ raise ValueError("You must specify either a model or a checkpoint")
92
+
90
93
  if batch_size == "max":
91
94
  log_warn_once(
92
95
  "Starting from together>=1.3.0, "
@@ -96,6 +99,8 @@ def createFinetuneRequest(
96
99
  warmup_ratio = 0.0
97
100
 
98
101
  training_type: TrainingType = FullTrainingType()
102
+ max_batch_size: int = 0
103
+ min_batch_size: int = 0
99
104
  if lora:
100
105
  if model_limits.lora_training is None:
101
106
  raise ValueError("LoRA adapters are not supported for the selected model.")
@@ -108,18 +113,26 @@ def createFinetuneRequest(
108
113
  lora_trainable_modules=lora_trainable_modules,
109
114
  )
110
115
 
111
- batch_size = (
112
- batch_size
113
- if batch_size != "max"
114
- else model_limits.lora_training.max_batch_size
115
- )
116
+ max_batch_size = model_limits.lora_training.max_batch_size
117
+ min_batch_size = model_limits.lora_training.min_batch_size
118
+
116
119
  else:
117
120
  if model_limits.full_training is None:
118
121
  raise ValueError("Full training is not supported for the selected model.")
119
- batch_size = (
120
- batch_size
121
- if batch_size != "max"
122
- else model_limits.full_training.max_batch_size
122
+
123
+ max_batch_size = model_limits.full_training.max_batch_size
124
+ min_batch_size = model_limits.full_training.min_batch_size
125
+
126
+ batch_size = batch_size if batch_size != "max" else max_batch_size
127
+
128
+ if batch_size > max_batch_size:
129
+ raise ValueError(
130
+ "Requested batch size is higher that the maximum allowed value."
131
+ )
132
+
133
+ if batch_size < min_batch_size:
134
+ raise ValueError(
135
+ "Requested batch size is lower that the minimum allowed value."
123
136
  )
124
137
 
125
138
  if warmup_ratio > 1 or warmup_ratio < 0:
@@ -346,9 +359,6 @@ class FineTuning:
346
359
  FinetuneResponse: Object containing information about fine-tuning job.
347
360
  """
348
361
 
349
- if model is None and from_checkpoint is None:
350
- raise ValueError("You must specify either a model or a checkpoint")
351
-
352
362
  requestor = api_requestor.APIRequestor(
353
363
  client=self._client,
354
364
  )
@@ -737,9 +747,6 @@ class AsyncFineTuning:
737
747
  FinetuneResponse: Object containing information about fine-tuning job.
738
748
  """
739
749
 
740
- if model is None and from_checkpoint is None:
741
- raise ValueError("You must specify either a model or a checkpoint")
742
-
743
750
  requestor = api_requestor.APIRequestor(
744
751
  client=self._client,
745
752
  )
@@ -170,7 +170,7 @@ class FinetuneRequest(BaseModel):
170
170
  # validation file id
171
171
  validation_file: str | None = None
172
172
  # base model string
173
- model: str
173
+ model: str | None = None
174
174
  # number of epochs to train for
175
175
  n_epochs: int
176
176
  # training learning rate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 1.5.2
3
+ Version: 1.5.3
4
4
  Summary: Python client for Together's Cloud Platform!
5
5
  License: Apache-2.0
6
6
  Author: Together AI
@@ -33,7 +33,7 @@ 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=XkVdAdCLVeJQly9QU9HsV7YOog6yMygJgS0WFWVWHtE,35825
36
+ together/resources/finetune.py,sha256=IUOBHSfeNNpZIiuL2w51SUZrqNvmbmvxs8kr-Ry15_w,36079
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
@@ -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=RXiqKG4PJuVxd92KlWAvp5ThzTyDrdFTog237XtMplc,10480
51
+ together/types/finetune.py,sha256=gREerRx3NA1mOXf2hGq6mh_FjpePNK5TiGbVGkRaDZQ,10494
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.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,,
61
+ together-1.5.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
+ together-1.5.3.dist-info/METADATA,sha256=AtudiOCi4iPbIEH45ErsqRa1hdTLQgAU_g1UQ3dkSKc,14397
63
+ together-1.5.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
64
+ together-1.5.3.dist-info/entry_points.txt,sha256=G-b5NKW6lUUf1V1fH8IPTBb7jXnK7lhbX9H1zTEJXPs,50
65
+ together-1.5.3.dist-info/RECORD,,