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
相关推荐
sleven fung1 天前
llama-cpp-python 本地部署入门
开发语言·python·算法·llama
碳基硅坊1 天前
Qwen3.6-27B 本地部署三大工具:Ollama、LM Studio、llama.cpp 谁更快?
人工智能·llama·大模型部署
小何code2 天前
人工智能【第53篇】大模型微调实战:LoRA与QLoRA技术详解
lora·llama·peft·qlora·大模型微调
kuokay2 天前
深入理解 LLM 分布式训练全栈:从硬件到 LLaMA-Factory
分布式·llama·deepspeed·fsdp·llama-factory·accelerate
C137的本贾尼3 天前
Spring AI Alibaba 模型全家桶:接入通义、百川、LLaMA 等第三方 LLM
人工智能·spring·llama
心疼你的一切4 天前
Llama.Cpp 本地大模型极速部署与调用指南
人工智能·ai·aigc·llama
hyunbar4 天前
llama_index.vector_stores 模块没有怎么办?
python·llama
Felven5 天前
llama.cpp 模型使用指南-本地大语言模型部署实践与长上下文内存估算参考手册
ai·语言模型·llama
skywalk81635 天前
使用llama.cpp运行模型unsloth/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf 速度大约5.5 token/s
人工智能·llama