|
@@ -138,7 +138,7 @@ class ModelTrainer:
|
|
|
model = FastLanguageModel.get_peft_model(
|
|
|
model,
|
|
|
max_seq_length=self.max_seq_length, # 最大上下文(序列)长度
|
|
|
- r=16, # LoRA 的秩,控制适配器的复杂度
|
|
|
+ r=8, # 16 # LoRA 的秩,控制适配器的复杂度
|
|
|
target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
|
|
|
"gate_proj", "up_proj", "down_proj"], # 应用 LoRA 的目标模块
|
|
|
lora_alpha=16, # LoRA 的 alpha 参数,控制适配器的缩放
|
|
@@ -188,7 +188,7 @@ class ModelTrainer:
|
|
|
fp16 = not is_bfloat16_supported(),
|
|
|
per_device_train_batch_size = 1,
|
|
|
gradient_accumulation_steps = 1, # Increase to 4 for smoother training
|
|
|
- num_generations = 128, # 256 # 每次生成 4 个输出
|
|
|
+ num_generations = 128, # 256 # 每次生成 输出个数,值范围: 1 - 256
|
|
|
max_prompt_length = 128, # 256 # 输入提示的最大长度
|
|
|
max_completion_length = 128,# 200 # 生成内容的最大长度
|
|
|
num_train_epochs = 1, # Set to 1 for a full training run
|