retrieve_fine_tune {openai}R Documentation

Retrieve fine-tune

Description

Returns information about the specified fine-tune job. See this page for details.

Usage

retrieve_fine_tune(
  fine_tune_id,
  openai_api_key = Sys.getenv("OPENAI_API_KEY"),
  openai_organization = NULL
)

Arguments

fine_tune_id

required; 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.

Value

Returns a list, elements of which contains information about the fine-tune.

See Also

Other fine-tune functions: cancel_fine_tune(), create_fine_tune(), delete_fine_tune_model(), list_fine_tune_events(), list_fine_tunes()

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
)

id <- ifelse(
    length(info$data$id) > 1,
    info$data$id[length(info$data$id)],
    info$data$id
)

retrieve_fine_tune(fine_tune_id = id)

## End(Not run)

[Package openai version 0.4.1 Index]