您现在的位置是:Llama用于Windows上的Windows Factory微调Llama 3的基本操作 >>正文
Llama用于Windows上的Windows Factory微调Llama 3的基本操作
德薄能鲜网76人已围观
简介本博客参考了一些文章,例如:教程:使用llama_Factory微调llama3:8b大模型_llama3模型微调保存-CSDN博客。也可以参考Llamama...
本博客参考了一些文章,例如:教程:使用llama_Factory微调llama3:8b大模型_llama3模型微调保存-CSDN博客。
也可以参考Llamama。 FactoryReadme:GitHub - hiyouga/LLaMA-Factory: Unify Efficient Fine-Tuning of 100+ LLMs。Unify Efficient Fine-Tuning of 100+ LLMs. Contribute to hiyouga/LLaMA-Factory development by creating an account on GitHub.。https://github.com/hiyouga/LLaMA-Factory?tab=readme-ov-file#installation。首先是Llama Factory clone到本地:GitHub - hiyouga/LLaMA-Factory: Unify Efficient Fine-Tuning of 100+ LLMs 。
其次,创建conda环境:
conda create -n llama_factory python=3.10
激活环境后,首先安装pytorch,参考此页面:Start Locally | PyTorch,例如:
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia。
然后进入LLAMA-Factory文件夹参考Readme༌操作:
pip install -e .[torch,metrics]。
同时,根据Readme༌Windows系统还需要运行:
pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl。
我就不谈具体原因了。然后依次运行
Set CUDA_VISIBLE_DEVICES=0Set GRADIO_SHARE=llamafactory-cli webui。
你可以看到它的webui。然而,目前还没有模型参数文件对于国内用户来说,,可以在这里。https://modelscope.cn/organization/LLM-Research。https://modelscope.cn/organization/LLM-Research。
下载,例如,可以下载Llama3中文版(假如没有git lfs可以用前两个命令安装):
conda install git-lfsgit-lfs installgit lfs clone https://www.modelscope.cn/LLM-Research/Llama3-8BB-Chinese-Chat.git。
下载后,可以构建自己的微调数据集,具体来说,,根据这里的介绍:
https://github.com/hiyouga/LLaMA-Factory/tree/main/data。
Llama Factory支持alpacaca and sharegpt格式,前者类似于这种格式:
[ { "instruction": "human instruction (required)", "input": "human input (optional)", "output": "model response (required)", "system": "system prompt (optional)", "history": [ ["human instruction in the first round (optional)", "model response in the first round (optional)"], ["human instruction in the second round (optional)", "model response in the second round (optional)"] ] }]。
当我们构建数据集时c;最简单的方法就是只构建instruction和output。
当我们构建数据集时,最简单的方法就是只构建instruction和output。将生成的json文件放入LLaMA-Factorydata目录,然后打开dataset_info.json文件,增加文件名记录,例如,我在这里添加:
"private_train": { 。
"file_name": "private_train.json"
},
选择自己的私人数据集,可以预览,然后就可以开始训练了。
训练结束后,切换到Export,然后在上述“微调方法”-“检查点路径”中选择刚刚存储的目录Train_2024_xxxx等,然后指定导出文件的目录,然后就可以导出了。
导出后,我们可以加载微调模型并进行测试。当然,若训练数据集相对较小,测试效果不会太好。如果你只是想展示微调的效果和特定的问题c;可以训练模型到拟合,呵呵呵。
记录这么多。Tags:
相关文章
美的501L法式多门冰箱MR
Llama用于Windows上的Windows Factory微调Llama 3的基本操作...
阅读更多
【优选算法】D&C
Llama用于Windows上的Windows Factory微调Llama 3的基本操作文章目录1.概念解析2.颜色分类3.排序数组4.数组中的第k个最大元素5.库存管理Ⅲ希望读者们多多三连支持小编会继续更新你们的鼓励就是我前进的动力!本篇是优选算法之分治-快排...
阅读更多
音频基础:窄带、宽带、超宽带、全带
Llama用于Windows上的Windows Factory微调Llama 3的基本操作#xff1a;窄带、宽带、超宽带、全带一次说透。窄带、宽带、超宽带、全带定义。参考资料。在音频信号中窄带、宽带等说法经常遇到,本文进行了总结和分类。窄带、宽带、超宽带、...
阅读更多