pub struct LoraTrainerConfig {Show 13 fields
pub base_model: String,
pub lora_rank: u32,
pub lora_alpha: f32,
pub lora_dropout: f32,
pub epochs: u32,
pub batch_size: u32,
pub gradient_accumulation: u32,
pub learning_rate: f32,
pub max_seq_length: u32,
pub train_script: PathBuf,
pub output_dir: PathBuf,
pub data_dir: PathBuf,
pub python_path: PathBuf,
}Expand description
LoRA Trainer の設定
Fields§
§base_model: Stringベースモデル (HuggingFace ID or path)
lora_rank: u32LoRA rank
lora_alpha: f32LoRA alpha
lora_dropout: f32Dropout rate
epochs: u32学習エポック数
batch_size: u32バッチサイズ
gradient_accumulation: u32勾配蓄積ステップ
learning_rate: f32学習率
max_seq_length: u32最大シーケンス長
train_script: PathBuftrain.py のパス
output_dir: PathBuf出力ディレクトリ(アダプタ保存先)
data_dir: PathBuf学習データ一時ファイル
python_path: PathBufPython 実行パス
Implementations§
Source§impl LoraTrainerConfig
impl LoraTrainerConfig
Sourcepub fn base_model(self, model: impl Into<String>) -> Self
pub fn base_model(self, model: impl Into<String>) -> Self
ベースモデルを設定
Sourcepub fn lora_alpha(self, alpha: f32) -> Self
pub fn lora_alpha(self, alpha: f32) -> Self
LoRA alpha を設定
Sourcepub fn batch_size(self, size: u32) -> Self
pub fn batch_size(self, size: u32) -> Self
バッチサイズを設定
Sourcepub fn learning_rate(self, lr: f32) -> Self
pub fn learning_rate(self, lr: f32) -> Self
学習率を設定
Sourcepub fn train_script(self, path: impl Into<PathBuf>) -> Self
pub fn train_script(self, path: impl Into<PathBuf>) -> Self
train.py のパスを設定
Sourcepub fn output_dir(self, path: impl Into<PathBuf>) -> Self
pub fn output_dir(self, path: impl Into<PathBuf>) -> Self
出力ディレクトリを設定
Sourcepub fn python_path(self, path: impl Into<PathBuf>) -> Self
pub fn python_path(self, path: impl Into<PathBuf>) -> Self
Python パスを設定
Trait Implementations§
Source§impl Clone for LoraTrainerConfig
impl Clone for LoraTrainerConfig
Source§fn clone(&self) -> LoraTrainerConfig
fn clone(&self) -> LoraTrainerConfig
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 LoraTrainerConfig
impl Debug for LoraTrainerConfig
Auto Trait Implementations§
impl Freeze for LoraTrainerConfig
impl RefUnwindSafe for LoraTrainerConfig
impl Send for LoraTrainerConfig
impl Sync for LoraTrainerConfig
impl Unpin for LoraTrainerConfig
impl UnwindSafe for LoraTrainerConfig
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