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
NULL
; a length one character vector.- model
required; a length one character vector.
- n_epochs
required; defaults to
4
; a length one numeric vector with the integer value greater than0
.- batch_size
optional; defaults to
NULL
; a length one numeric vector with the integer value greater than0
.- learning_rate_multiplier
optional; defaults to
NULL
; a length one numeric vector with the value greater than0
.- prompt_loss_weight
required; defaults to
0.1
; a length one numeric vector.- compute_classification_metrics
required; defaults to
FLASE
; a length one logical vector.- classification_n_classes
optional; defaults to
NULL
; a length one numeric vector with the value greater than0
.- classification_positive_class
optional; defaults to
NULL
; a length one character vector.- classification_betas
optional; defaults to
NULL
; a list elements of which are numeric values greater than0
.- suffix
optional; defaults to
NULL
; a length one character vector.- openai_api_key
required; defaults to
Sys.getenv("OPENAI_API_KEY")
(i.e., the value is retrieved from the.Renviron
file); a length one character vector. Specifies OpenAI API key.- openai_organization
optional; defaults to
NULL
; a length one character vector. Specifies OpenAI organization.
Details
For arguments description please refer to the official documentation.
See also
Other fine-tune functions:
cancel_fine_tune()
,
delete_fine_tune_model()
,
list_fine_tune_events()
,
list_fine_tunes()
,
retrieve_fine_tune()
Examples
if (FALSE) { # \dontrun{
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
)
} # }