Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. 参数配置扩展 (
arguments.py)新增LoRA相关参数:
use_lora: 是否启用LoRA训练lora_r: LoRA秩,默认8lora_alpha: LoRA缩放因子,默认16lora_dropout: dropout率,默认0.05lora_target_modules: 目标模块,默认"q_proj"2. 配置文件更新 (
configs/config.json)添加LoRA配置示例:
use_lora: true)3. 模型集成 (
model.py)新增PEFT库导入:
from peft import LoraConfig, get_peft_model, TaskType在
F2LLM类中添加_apply_lora()方法:4. 依赖更新 (
requirements.txt)peft5. 训练流程优化 (
run.py)修复gradient checkpointing的兼容性问题
优化参数选择逻辑: