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
相关推荐
liliangcsdn3 天前
mac测试ollama llamaindex
数据仓库·人工智能·prompt·llama
茫茫人海一粒沙3 天前
使用 LLaMA 3 8B 微调一个 Reward Model:从入门到实践
llama
liliangcsdn5 天前
mac llama_index agent算术式子计算示例
人工智能·python·macos·llama
许愿与你永世安宁6 天前
RAG(检索增强生成)里的文档管理
数据库·人工智能·gpt·oracle·llama·rag
许愿与你永世安宁10 天前
基于Llama的RAG 3种模型配置方法
人工智能·python·自然语言处理·json·github·llama·faiss
至善迎风10 天前
本地部署 Kimi K2 全指南(llama.cpp、vLLM、Docker 三法)
docker·容器·llama·kimi
阿斯卡码10 天前
安装 llama-cpp-python 的CPU和GPU方法
开发语言·python·llama
学不会就看10 天前
llama-factory快速开始
llama
NullPointerExpection13 天前
LLM大语言模型不适合统计算数,可以让大模型根据数据自己建表、插入数据、编写查询sql统计
数据库·人工智能·sql·算法·llm·llama·工作流
MUTA️13 天前
Llama系列:Llama1, Llama2,Llama3内容概述
llama