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
相关推荐
范男12 小时前
Qwen3-VL + LLama-Factory进行针对Grounding任务LoRA微调
人工智能·深度学习·计算机视觉·transformer·llama
忘记57821 小时前
下载llama factory
llama
路边草随风21 小时前
llama_index简单使用
人工智能·python·llama
王威振的csdn2 天前
法律大模型微调:基于 LLaMA-Factory 的指令微调方案
llama
JoannaJuanCV2 天前
大模型训练:LLaMA-Factory快速上手
llama
java_logo2 天前
LANGFUSE Docker 容器化部署指南
运维·docker·云原生·容器·eureka·llama
weixin_446260852 天前
二、LLaMA Factory 介绍和基本使用
llama
weixin_446260853 天前
三、LLaMA Factory 微调通用设置
llama
木枷4 天前
LLama-factory数据报错
人工智能·机器学习·llama
快乐的钢镚子5 天前
【RAG实战】中医医疗问答系统
langchain·llama