Class: OpenAI::Models::FineTuning::FineTuningJob

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/fine_tuning/fine_tuning_job.rb,
sig/openai/models/fine_tuning/fine_tuning_job.rbs

Overview

See Also:

  • OpenAI::Resources::FineTuning::Jobs#create

Defined Under Namespace

Modules: Status Classes: Error, Hyperparameters, Method

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(code:, message:, param:) ⇒ FineTuningJob

Returns a new instance of FineTuningJob.

Parameters:

  • id —

    The object identifier, which can be referenced in the API endpoints.

  • created_at —

    The Unix timestamp (in seconds) for when the fine-tuning job was created.

  • error —

    For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

  • fine_tuned_model —

    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

  • finished_at —

    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.

  • hyperparameters —

    The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.

  • model —

    The base model that is being fine-tuned.

  • organization_id —

    The organization that owns the fine-tuning job.

  • result_files —

    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

  • seed —

    The seed used for the fine-tuning job.

  • status —

    The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

  • trained_tokens —

    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.

  • training_file —

    The file ID used for training. You can retrieve the training data with the Files API.

  • validation_file —

    The file ID used for validation. You can retrieve the validation results with the Files API.

  • estimated_finish —

    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.

  • integrations —

    A list of integrations to enable for this fine-tuning job.

  • metadata —

    Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.

    Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

  • method_ —

    The method used for fine-tuning.

  • object —

    The object type, which is always "fine_tuning.job".

  • id: (String)
  • created_at: (Integer)
  • error: (OpenAI::FineTuning::FineTuningJob::Error, nil)
  • fine_tuned_model: (String, nil)
  • finished_at: (Integer, nil)
  • hyperparameters: (OpenAI::FineTuning::FineTuningJob::Hyperparameters)
  • model: (String)
  • organization_id: (String)
  • result_files: (::Array[String])
  • seed: (Integer)
  • status: (OpenAI::Models::FineTuning::FineTuningJob::status)
  • trained_tokens: (Integer, nil)
  • training_file: (String)
  • validation_file: (String, nil)
  • estimated_finish: (Integer, nil)
  • integrations: (::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject], nil)
  • metadata: (OpenAI::Models::metadata, nil)
  • method_: (OpenAI::FineTuning::FineTuningJob::Method)
  • object: (:"fine_tuning.job")


# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 144

Instance Attribute Details

#created_at ⇒ Integer

The Unix timestamp (in seconds) for when the fine-tuning job was created.

Returns:

  • (Integer)


18
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 18

required :created_at, Integer

#error ⇒ OpenAI::FineTuning::FineTuningJob::Error?

For fine-tuning jobs that have failed, this will contain more information on the cause of the failure.

Returns:

  • (OpenAI::FineTuning::FineTuningJob::Error, nil)


25
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 25

required :error, -> { OpenAI::FineTuning::FineTuningJob::Error }, nil?: true

#estimated_finish ⇒ Integer?

The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.

Returns:

  • (Integer, nil)


114
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 114

optional :estimated_finish, Integer, nil?: true

#fine_tuned_model ⇒ String?

The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.

Returns:

  • (String, nil)


32
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 32

required :fine_tuned_model, String, nil?: true

#finished_at ⇒ Integer?

The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.

Returns:

  • (Integer, nil)


39
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 39

required :finished_at, Integer, nil?: true

#hyperparameters ⇒ OpenAI::FineTuning::FineTuningJob::Hyperparameters

The hyperparameters used for the fine-tuning job. This value will only be returned when running supervised jobs.

Returns:

  • (OpenAI::FineTuning::FineTuningJob::Hyperparameters)


46
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 46

required :hyperparameters, -> { OpenAI::FineTuning::FineTuningJob::Hyperparameters }

#id ⇒ String

The object identifier, which can be referenced in the API endpoints.

Returns:

  • (String)


12
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 12

required :id, String

#integrations ⇒ ::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject]?

A list of integrations to enable for this fine-tuning job.

Returns:

  • (::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject], nil)


120
121
122
123
124
125
126
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 120

optional(
  :integrations,
  -> {
    OpenAI::Internal::Type::ArrayOf[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject]
  },
  nil?: true
)

#metadata ⇒ OpenAI::Models::metadata?

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

  • (OpenAI::Models::metadata, nil)


136
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 136

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#method_ ⇒ OpenAI::FineTuning::FineTuningJob::Method?

The method used for fine-tuning.

Returns:

  • (OpenAI::FineTuning::FineTuningJob::Method, nil)


142
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 142

optional :method_, -> { OpenAI::FineTuning::FineTuningJob::Method }, api_name: :method

#model ⇒ String

The base model that is being fine-tuned.

Returns:

  • (String)


52
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 52

required :model, String

#object ⇒ :"fine_tuning.job"

The object type, which is always "fine_tuning.job".

Returns:

  • (:"fine_tuning.job")


58
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 58

required :object, const: :"fine_tuning.job"

#organization_id ⇒ String

The organization that owns the fine-tuning job.

Returns:

  • (String)


64
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 64

required :organization_id, String

#result_files ⇒ ::Array[String]

The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the Files API.

Returns:

  • (::Array[String])


72
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 72

required :result_files, OpenAI::Internal::Type::ArrayOf[String]

#seed ⇒ Integer

The seed used for the fine-tuning job.

Returns:

  • (Integer)


78
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 78

required :seed, Integer

#status ⇒ OpenAI::Models::FineTuning::FineTuningJob::status

The current status of the fine-tuning job, which can be either validating_files, queued, running, succeeded, failed, or cancelled.

Returns:

  • (OpenAI::Models::FineTuning::FineTuningJob::status)


85
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 85

required :status, enum: -> { OpenAI::FineTuning::FineTuningJob::Status }

#trained_tokens ⇒ Integer?

The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.

Returns:

  • (Integer, nil)


92
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 92

required :trained_tokens, Integer, nil?: true

#training_file ⇒ String

The file ID used for training. You can retrieve the training data with the Files API.

Returns:

  • (String)


99
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 99

required :training_file, String

#validation_file ⇒ String?

The file ID used for validation. You can retrieve the validation results with the Files API.

Returns:

  • (String, nil)


107
# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 107

required :validation_file, String, nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 363

.variants ⇒ Array(Symbol, :auto, Integer)

Returns:

  • (Array(Symbol, :auto, Integer))


# File 'lib/openai/models/fine_tuning/fine_tuning_job.rb', line 344

Instance Method Details

#to_hash ⇒ { id: String, created_at: Integer, error: OpenAI::FineTuning::FineTuningJob::Error?, fine_tuned_model: String?, finished_at: Integer?, hyperparameters: OpenAI::FineTuning::FineTuningJob::Hyperparameters, model: String, ?object: :"fine_tuning.job", organization_id: String, result_files: ::Array[String], seed: Integer, status: OpenAI::Models::FineTuning::FineTuningJob::status, trained_tokens: Integer?, training_file: String, validation_file: String?, ?estimated_finish: Integer?, ?integrations: ::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject]?, ?metadata: OpenAI::Models::metadata?, ?method_: OpenAI::FineTuning::FineTuningJob::Method }

Returns:

  • ({ id: String, created_at: Integer, error: OpenAI::FineTuning::FineTuningJob::Error?, fine_tuned_model: String?, finished_at: Integer?, hyperparameters: OpenAI::FineTuning::FineTuningJob::Hyperparameters, model: String, ?object: :"fine_tuning.job", organization_id: String, result_files: ::Array[String], seed: Integer, status: OpenAI::Models::FineTuning::FineTuningJob::status, trained_tokens: Integer?, training_file: String, validation_file: String?, ?estimated_finish: Integer?, ?integrations: ::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject]?, ?metadata: OpenAI::Models::metadata?, ?method_: OpenAI::FineTuning::FineTuningJob::Method })


184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'sig/openai/models/fine_tuning/fine_tuning_job.rbs', line 184

def to_hash: -> {
  id: String,
  created_at: Integer,
  error: OpenAI::FineTuning::FineTuningJob::Error?,
  fine_tuned_model: String?,
  finished_at: Integer?,
  hyperparameters: OpenAI::FineTuning::FineTuningJob::Hyperparameters,
  model: String,
  ?object: :"fine_tuning.job",
  organization_id: String,
  result_files: ::Array[String],
  seed: Integer,
  status: OpenAI::Models::FineTuning::FineTuningJob::status,
  trained_tokens: Integer?,
  training_file: String,
  validation_file: String?,
  ?estimated_finish: Integer?,
  ?integrations: ::Array[OpenAI::FineTuning::FineTuningJobWandbIntegrationObject]?,
  ?metadata: OpenAI::Models::metadata?,
  ?method_: OpenAI::FineTuning::FineTuningJob::Method
}