Skip to main content

entrenar/hf_pipeline/fine_tune/
method.rs

1//! Fine-tuning method selection
2//!
3//! Different approaches for adapting pretrained models.
4
5use crate::lora::LoRAConfig;
6
7/// Fine-tuning method selection
8#[derive(Debug, Clone)]
9pub enum FineTuneMethod {
10    /// Full fine-tuning (all parameters trainable)
11    Full,
12    /// LoRA: Low-rank adaptation (Hu et al. 2021)
13    LoRA(LoRAConfig),
14    /// QLoRA: Quantized LoRA (Dettmers et al. 2023)
15    QLoRA {
16        /// LoRA configuration
17        lora_config: LoRAConfig,
18        /// Quantization bits (4 or 8)
19        bits: u8,
20    },
21    /// Prefix tuning (Li & Liang 2021)
22    PrefixTuning {
23        /// Number of prefix tokens
24        prefix_length: usize,
25    },
26}
27
28impl Default for FineTuneMethod {
29    fn default() -> Self {
30        Self::LoRA(LoRAConfig::default())
31    }
32}