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
相关推荐
yagami_gagami13 分钟前
第四届黄河流域公安院校电子物证个人赛服务器取证
linux·服务器·网络·mysql·安全·docker·llama
(轻舟已过万重山)2 天前
第16章 主流开源模型选型:Qwen/LLaMA/GLM/Mistral 怎么选
人工智能·开源·llama
染指11102 天前
72.高级RAG-sql检索器
python·sql·mysql·llama·llamaindex·高级rag
孪生质数-4 天前
AI 应用实践篇——让大模型真正开始工作
linux·运维·服务器·人工智能·深度学习·语言模型·llama
刹那芳华19924 天前
基于 Docker 的 LLaMA-Factory 全流程部署指南
docker·容器·llama
grey_csdn9 天前
1928_llama.cpp部署Qwen 3.6-35B-A3B扩充识图功能
llama
码云骑士9 天前
78-LLaMA-Factory微调实战-零代码训练-LoRA参数配置-训练曲线解读
python·llama
寒水馨10 天前
Linux下载、安装llama.cpp-b10068(附安装包llama-b10068-bin-ubuntu-vulkan-x64.tar.gz)
linux·ubuntu·llm·llama·本地部署·llama.cpp·推理引擎
千天夜11 天前
让大模型“先想再答”:Chain-of-Thought Prompting 论文精读——CoT 为什么能激发多步推理?
人工智能·深度学习·llm·gpt-3·llama
网络工程小王11 天前
【HCIE-AI】10.pytorch模型迁移分析
人工智能·学习·华为·llama