create_fine_tune {openai} | R Documentation |
Create fine-tune
Description
Creates a job that fine-tunes a specified model based on a given dataset. See this page for details.
Usage
create_fine_tune(
training_file,
validation_file = NULL,
model,
n_epochs = 4,
batch_size = NULL,
learning_rate_multiplier = NULL,
prompt_loss_weight = 0.1,
compute_classification_metrics = FALSE,
classification_n_classes = NULL,
classification_positive_class = NULL,
classification_betas = NULL,
suffix = NULL,
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
openai_organization = NULL
)
Arguments
training_file |
required; a length one character vector. |
validation_file |
optional; defaults to |
model |
required; a length one character vector. |
n_epochs |
required; defaults to |
batch_size |
optional; defaults to |
learning_rate_multiplier |
optional; defaults to |
prompt_loss_weight |
required; defaults to |
compute_classification_metrics |
required; defaults to |
classification_n_classes |
optional; defaults to |
classification_positive_class |
optional; defaults to |
classification_betas |
optional; defaults to |
suffix |
optional; defaults to |
openai_api_key |
required; defaults to |
openai_organization |
optional; defaults to |
Details
For arguments description please refer to the official documentation.
Value
Returns a list, elements of which contain information about the fine-tune.
See Also
Other fine-tune functions:
cancel_fine_tune()
,
delete_fine_tune_model()
,
list_fine_tune_events()
,
list_fine_tunes()
,
retrieve_fine_tune()
Examples
## Not run:
training_file <- system.file(
"extdata", "sport_prepared_train.jsonl", package = "openai"
)
validation_file <- system.file(
"extdata", "sport_prepared_train.jsonl", package = "openai"
)
training_info <- upload_file(training_file, "fine-tune")
validation_info <- upload_file(validation_file, "fine-tune")
info <- create_fine_tune(
training_file = training_info$id,
validation_file = validation_info$id,
model = "ada",
compute_classification_metrics = TRUE,
classification_positive_class = " baseball" # Mind space in front
)
## End(Not run)