Class: OpenAI::Resources::FineTuning::Jobs

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/fine_tuning/jobs.rb,
lib/openai/resources/fine_tuning/jobs/checkpoints.rb

Defined Under Namespace

Classes: Checkpoints

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Jobs

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Jobs.

Parameters:



214
215
216
217
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 214

def initialize(client:)
  @client = client
  @checkpoints = OpenAI::Resources::FineTuning::Jobs::Checkpoints.new(client: client)
end

Instance Attribute Details

#checkpointsOpenAI::Resources::FineTuning::Jobs::Checkpoints (readonly)



8
9
10
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 8

def checkpoints
  @checkpoints
end

Instance Method Details

#cancel(fine_tuning_job_id, request_options: {}) ⇒ OpenAI::Models::FineTuning::FineTuningJob

Some parameter documentations has been truncated, see Models::FineTuning::JobCancelParams for more details.

Immediately cancel a fine-tune job.

Parameters:

  • fine_tuning_job_id (String)

    The ID of the fine-tuning job to cancel.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



126
127
128
129
130
131
132
133
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 126

def cancel(fine_tuning_job_id, params = {})
  @client.request(
    method: :post,
    path: ["fine_tuning/jobs/%1$s/cancel", fine_tuning_job_id],
    model: OpenAI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end

#create(model: , training_file: , hyperparameters: nil, integrations: nil, metadata: nil, method_: nil, seed: nil, suffix: nil, validation_file: nil, request_options: {}) ⇒ OpenAI::Models::FineTuning::FineTuningJob

Some parameter documentations has been truncated, see Models::FineTuning::JobCreateParams for more details.

Creates a fine-tuning job which begins the process of creating a new model from a given dataset.

Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.

[Learn more about fine-tuning](platform.openai.com/docs/guides/fine-tuning)

Parameters:

Returns:

See Also:



46
47
48
49
50
51
52
53
54
55
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 46

def create(params)
  parsed, options = OpenAI::FineTuning::JobCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "fine_tuning/jobs",
    body: parsed,
    model: OpenAI::FineTuning::FineTuningJob,
    options: options
  )
end

#list(after: nil, limit: nil, metadata: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::FineTuning::FineTuningJob>

Some parameter documentations has been truncated, see Models::FineTuning::JobListParams for more details.

List your organization’s fine-tuning jobs

Parameters:

  • after (String)

    Identifier for the last job from the previous pagination request.

  • limit (Integer)

    Number of fine-tuning jobs to retrieve.

  • metadata (Hash{Symbol=>String}, nil)

    Optional metadata filter. To filter, use the syntax ‘metadata=v`. Alternative

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 100

def list(params = {})
  parsed, options = OpenAI::FineTuning::JobListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "fine_tuning/jobs",
    query: parsed,
    page: OpenAI::Internal::CursorPage,
    model: OpenAI::FineTuning::FineTuningJob,
    options: options
  )
end

#list_events(fine_tuning_job_id, after: nil, limit: nil, request_options: {}) ⇒ OpenAI::Internal::CursorPage<OpenAI::Models::FineTuning::FineTuningJobEvent>

Some parameter documentations has been truncated, see Models::FineTuning::JobListEventsParams for more details.

Get status updates for a fine-tuning job.

Parameters:

  • fine_tuning_job_id (String)

    The ID of the fine-tuning job to get events for.

  • after (String)

    Identifier for the last event from the previous pagination request.

  • limit (Integer)

    Number of events to retrieve.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



153
154
155
156
157
158
159
160
161
162
163
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 153

def list_events(fine_tuning_job_id, params = {})
  parsed, options = OpenAI::FineTuning::JobListEventsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["fine_tuning/jobs/%1$s/events", fine_tuning_job_id],
    query: parsed,
    page: OpenAI::Internal::CursorPage,
    model: OpenAI::FineTuning::FineTuningJobEvent,
    options: options
  )
end

#pause(fine_tuning_job_id, request_options: {}) ⇒ OpenAI::Models::FineTuning::FineTuningJob

Some parameter documentations has been truncated, see Models::FineTuning::JobPauseParams for more details.

Pause a fine-tune job.

Parameters:

  • fine_tuning_job_id (String)

    The ID of the fine-tuning job to pause.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



179
180
181
182
183
184
185
186
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 179

def pause(fine_tuning_job_id, params = {})
  @client.request(
    method: :post,
    path: ["fine_tuning/jobs/%1$s/pause", fine_tuning_job_id],
    model: OpenAI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end

#resume(fine_tuning_job_id, request_options: {}) ⇒ OpenAI::Models::FineTuning::FineTuningJob

Some parameter documentations has been truncated, see Models::FineTuning::JobResumeParams for more details.

Resume a fine-tune job.

Parameters:

  • fine_tuning_job_id (String)

    The ID of the fine-tuning job to resume.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



202
203
204
205
206
207
208
209
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 202

def resume(fine_tuning_job_id, params = {})
  @client.request(
    method: :post,
    path: ["fine_tuning/jobs/%1$s/resume", fine_tuning_job_id],
    model: OpenAI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end

#retrieve(fine_tuning_job_id, request_options: {}) ⇒ OpenAI::Models::FineTuning::FineTuningJob

Some parameter documentations has been truncated, see Models::FineTuning::JobRetrieveParams for more details.

Get info about a fine-tuning job.

[Learn more about fine-tuning](platform.openai.com/docs/guides/fine-tuning)

Parameters:

  • fine_tuning_job_id (String)

    The ID of the fine-tuning job.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



73
74
75
76
77
78
79
80
# File 'lib/openai/resources/fine_tuning/jobs.rb', line 73

def retrieve(fine_tuning_job_id, params = {})
  @client.request(
    method: :get,
    path: ["fine_tuning/jobs/%1$s", fine_tuning_job_id],
    model: OpenAI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end