Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion safetytooling/apis/finetuning/openai/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import openai
import openai.types.fine_tuning
from openai import APIConnectionError, RateLimitError
from openai import NOT_GIVEN, APIConnectionError, RateLimitError
from safetytooling.apis.finetuning.openai.check import openai_check_finetuning_data
from safetytooling.apis.inference.openai import utils as openai_utils
from safetytooling.data_models.finetune import FinetuneConfig
Expand Down Expand Up @@ -97,6 +97,7 @@ async def queue_finetune(
},
},
validation_file=val_file_id,
seed=cfg.seed if cfg.seed is not None else NOT_GIVEN,
)
elif cfg.method == "dpo":
ft_job = await client.fine_tuning.jobs.create(
Expand All @@ -114,6 +115,7 @@ async def queue_finetune(
},
},
validation_file=val_file_id,
seed=cfg.seed if cfg.seed is not None else NOT_GIVEN,
)
elif cfg.method == "reinforcement":
with open(cfg.config.grader_config, "r") as f:
Expand All @@ -133,6 +135,7 @@ async def queue_finetune(
},
},
validation_file=val_file_id,
seed=cfg.seed if cfg.seed is not None else NOT_GIVEN,
)

return ft_job
Expand Down
1 change: 1 addition & 0 deletions safetytooling/data_models/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class FinetuneConfig:
n_epochs: int = 1 # Number of epochs to train for
batch_size: int | str = 16
dry_run: bool = False # Just validate the data, don't launch the job
seed: int | None = None # Sets the finetune job seed. Currently only works for OpenAI.

logging_level: str = "info"

Expand Down