fine tuning with llama-factory

create data

bash 复制代码
sed -i 's/{{name}}/PonyBot/g'  data/identity.json 
sed -i 's/{{author}}/LLaMA Factory/g'  data/identity.json 

train

bash 复制代码
CUDA_VISIBLE_DEVICES=0 llamafactory-cli train \
    --stage sft \
    --do_train \
    --model_name_or_path /home/prometheus/module-test/llama-factory/LLM-Model/Qwen2.5-Coder-7B-Instruct \
    --dataset identity \
    --dataset_dir ./data \
    --template qwen \
    --finetuning_type lora \
    --output_dir ./saves/Qwen2.5-Coder-7B-Instruct/lora/sft \
    --overwrite_cache \
    --overwrite_output_dir \
    --cutoff_len 1024 \
    --preprocessing_num_workers 16 \
    --per_device_train_batch_size 2 \
    --per_device_eval_batch_size 1 \
    --gradient_accumulation_steps 8 \
    --lr_scheduler_type cosine \
    --logging_steps 50 \
    --warmup_steps 20 \
    --save_steps 100 \
    --eval_steps 50 \
    --evaluation_strategy steps \
    --load_best_model_at_end \
    --learning_rate 5e-5 \
    --num_train_epochs 5.0 \
    --max_samples 1000 \
    --val_size 0.1 \
    --plot_loss \
    --fp16

use llm with fine tuning

bash 复制代码
	export GRADIO_SERVER_PORT=7862
	CUDA_VISIBLE_DEVICES=0 llamafactory-cli webchat \
    --model_name_or_path /home/prometheus/module-test/llama-factory/LLM-Model/Qwen2.5-Coder-7B-Instruct \
    --adapter_name_or_path ./saves/Qwen2.5-Coder-7B-Instruct/lora/sft  \
	--template qwen \
    --finetuning_type lora
bash 复制代码
referenced:
	https://zhuanlan.zhihu.com/p/695287607
相关推荐
阡陌数智2 天前
Llama 4 MoE 架构深度拆解:交替稀疏专家设计与生产环境推理落地实战
架构·llama
论文复现现场2 天前
8卡4090能跑70B吗?Llama-2显存预算、QLoRA与通信瓶颈
人工智能·深度学习·分布式训练·llama·显存·qlora·算家云
Vd7H20A73 天前
Windows 下用 llama.cpp 运行 Qwen3.8-27B 并开启 512K 上下文 完全指南
windows·llama
jason.zeng@15022073 天前
(六)Prompt 优化
python·ai·langchain·prompt·ai编程·llama
jason.zeng@15022073 天前
(八)现有架构上新增一个通用Excel导出工具
python·架构·langchain·excel·llama
jason.zeng@15022073 天前
(九)多轮对话式新增维修记录实现方案
python·prompt·交互·llama
jason.zeng@15022073 天前
(五)多轮对话上下文,实现交互。
python·交互·llama
jason.zeng@15022073 天前
(十)分层架构的多文件工程
python·架构·prompt·交互·ai编程·llama
n112126 天前
4G 显存老显卡怎么跑模型:llama.cpp 加 GGUF 配置
llama·llama.cpp·本地大模型·gguf
打工仔折腾 AI7 天前
LLaMA 1 到 LLaMA 3 架构演进拆解:从 RoPE、GQA 到词表扩张
人工智能·后端·python·深度学习·langchain·llama