Skip to content

Commit e670b77

Browse files
committed
Add fixes
1 parent c39a9ad commit e670b77

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/together/cli/api/finetune.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ def fine_tuning(ctx: click.Context) -> None:
206206
default=None,
207207
help="HF API token to use to upload a checkpoint to a private repo",
208208
)
209+
@click.option(
210+
"--hf-repo-to-upload",
211+
type=str,
212+
default=None,
213+
help="HF repo to upload the fine-tuned model to",
214+
)
209215
def create(
210216
ctx: click.Context,
211217
training_file: str,
@@ -240,7 +246,8 @@ def create(
240246
rpo_alpha: float | None,
241247
simpo_gamma: float | None,
242248
from_checkpoint: str,
243-
hf_api_token: str,
249+
hf_api_token: str | None,
250+
hf_repo_to_upload: str | None,
244251
) -> None:
245252
"""Start fine-tuning"""
246253
client: Together = ctx.obj
@@ -278,6 +285,7 @@ def create(
278285
simpo_gamma=simpo_gamma,
279286
from_checkpoint=from_checkpoint,
280287
hf_api_token=hf_api_token,
288+
hf_repo_to_upload=hf_repo_to_upload,
281289
)
282290

283291
if model is None and from_checkpoint is None:

src/together/resources/finetune.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def create(
344344
simpo_gamma: float | None = None,
345345
from_checkpoint: str | None = None,
346346
hf_api_token: str | None = None,
347+
hf_repo_to_upload: str | None = None,
347348
) -> FinetuneResponse:
348349
"""
349350
Method to initiate a fine-tuning job
@@ -401,6 +402,7 @@ def create(
401402
The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
402403
The step value is optional, without it the final checkpoint will be used.
403404
hf_api_token (str, optional): API key for the Hugging Face Hub. Defaults to None.
405+
hf_repo_to_upload (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
404406
405407
Returns:
406408
FinetuneResponse: Object containing information about fine-tuning job.
@@ -455,6 +457,7 @@ def create(
455457
simpo_gamma=simpo_gamma,
456458
from_checkpoint=from_checkpoint,
457459
hf_api_token=hf_api_token,
460+
hf_repo_to_upload=hf_repo_to_upload,
458461
)
459462

460463
if verbose:
@@ -768,6 +771,7 @@ async def create(
768771
simpo_gamma: float | None = None,
769772
from_checkpoint: str | None = None,
770773
hf_api_token: str | None = None,
774+
hf_repo_to_upload: str | None = None,
771775
) -> FinetuneResponse:
772776
"""
773777
Async method to initiate a fine-tuning job
@@ -825,6 +829,7 @@ async def create(
825829
The format: {$JOB_ID/$OUTPUT_MODEL_NAME}:{$STEP}.
826830
The step value is optional, without it the final checkpoint will be used.
827831
hf_api_token (str, optional): API key for the Huggging Face Hub. Defaults to None.
832+
hf_repo_to_upload (str, optional): HF repo to upload the fine-tuned model to. Defaults to None.
828833
829834
Returns:
830835
FinetuneResponse: Object containing information about fine-tuning job.
@@ -878,8 +883,8 @@ async def create(
878883
rpo_alpha=rpo_alpha,
879884
simpo_gamma=simpo_gamma,
880885
from_checkpoint=from_checkpoint,
881-
from_hf_model=from_hf_model,
882886
hf_api_token=hf_api_token,
887+
hf_repo_to_upload=hf_repo_to_upload,
883888
)
884889

885890
if verbose:

src/together/types/finetune.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ class FinetuneRequest(BaseModel):
212212
)
213213
# from step
214214
from_checkpoint: str | None = None
215+
# hf related fields
215216
hf_api_token: str | None = None
217+
hf_repo_to_upload: str | None = None
216218

217219

218220
class FinetuneResponse(BaseModel):

0 commit comments

Comments
 (0)