LLaMa大模型微调

1. 模型的微调

1.1 大模型LLaMa下载

先下载一个完整版本的LLaMa模型,官网的或别人下载微调过的中文版本的。

1.2 指令微调

执行run_clm_sft_with_peft

1.3 合并LORA

大模型的原始参数和微调后的参数合并到一起

执行如下脚本:

scripts/merge_llama3_with_chinese_lora_low_mem.py

--base_model  原始预训练模型的路径

--lora_model 微调后的lora的路径

--output_dir 参数合并的输出目录

merge后的格式是safetensors

model-00001-of-00004.safetensors    4.63G

model-00002-of-00004.safetensors    4.63G

model-00003-of-00004.safetensors    4.63G

model-00004-of-00004.safetensors   4.63G

2. 量化

2.1 llama.cpp

llama.cpp链接:https://gitcode.com/ggerganov/llama.cpp/overview

需要先安装好CMAKE:https://cmake.org/down

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值