pub struct CreateFineTuningJobRequest {
pub model: FineTuningModel,
pub training_file: String,
pub validation_file: Option<String>,
pub suffix: Option<String>,
pub seed: Option<u64>,
pub method: Option<MethodConfig>,
pub integrations: Option<Vec<Integration>>,
}Expand description
Request to create a new fine-tuning job.
Fields§
§model: FineTuningModelThe base model to fine-tune.
training_file: StringThe ID of the uploaded training file.
validation_file: Option<String>The ID of the uploaded validation file (optional).
suffix: Option<String>A string suffix for the fine-tuned model name (max 64 chars).
seed: Option<u64>A seed for reproducibility.
method: Option<MethodConfig>The fine-tuning method and hyperparameters.
integrations: Option<Vec<Integration>>Integrations to enable (e.g., Weights & Biases).
Implementations§
Source§impl CreateFineTuningJobRequest
impl CreateFineTuningJobRequest
Sourcepub fn new(model: FineTuningModel, training_file: impl Into<String>) -> Self
pub fn new(model: FineTuningModel, training_file: impl Into<String>) -> Self
Creates a new fine-tuning job request with the given model and training file.
§Arguments
model- The base model to fine-tunetraining_file- The ID of the uploaded training file
§Example
use openai_tools::fine_tuning::request::CreateFineTuningJobRequest;
use openai_tools::common::models::FineTuningModel;
let request = CreateFineTuningJobRequest::new(
FineTuningModel::Gpt4oMini_2024_07_18,
"file-abc123"
);Sourcepub fn with_validation_file(self, file_id: impl Into<String>) -> Self
pub fn with_validation_file(self, file_id: impl Into<String>) -> Self
Sets the validation file for the job.
Sourcepub fn with_suffix(self, suffix: impl Into<String>) -> Self
pub fn with_suffix(self, suffix: impl Into<String>) -> Self
Sets the suffix for the fine-tuned model name.
Sourcepub fn with_supervised_method(
self,
hyperparameters: Option<Hyperparameters>,
) -> Self
pub fn with_supervised_method( self, hyperparameters: Option<Hyperparameters>, ) -> Self
Configures supervised fine-tuning with custom hyperparameters.
Sourcepub fn with_dpo_method(self, hyperparameters: Option<Hyperparameters>) -> Self
pub fn with_dpo_method(self, hyperparameters: Option<Hyperparameters>) -> Self
Configures DPO (Direct Preference Optimization) fine-tuning.
Sourcepub fn with_integrations(self, integrations: Vec<Integration>) -> Self
pub fn with_integrations(self, integrations: Vec<Integration>) -> Self
Adds integrations to the job.
Trait Implementations§
Source§impl Clone for CreateFineTuningJobRequest
impl Clone for CreateFineTuningJobRequest
Source§fn clone(&self) -> CreateFineTuningJobRequest
fn clone(&self) -> CreateFineTuningJobRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateFineTuningJobRequest
impl Debug for CreateFineTuningJobRequest
Auto Trait Implementations§
impl Freeze for CreateFineTuningJobRequest
impl RefUnwindSafe for CreateFineTuningJobRequest
impl Send for CreateFineTuningJobRequest
impl Sync for CreateFineTuningJobRequest
impl Unpin for CreateFineTuningJobRequest
impl UnwindSafe for CreateFineTuningJobRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more