LLaMA-Factory 框架
首先需要通过vscode连接远程服务器哦
如果是租赁的AutoDL服务器,一定要将模型下载到数据盘。
git clone https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
pip install -e .
准备训练数据
训练数据: fintech.json identity.json 将训练数据放在 LLaMA-Factory/data/fintech.json
并且修改数据注册文件:LLaMA-Factory/data/dataset_info.json
"fintech": {"file_name": "fintech.json","columns": {"prompt": "instruction","query": "input","response": "output","history": "history"}}
启动 Web UI
cd LLaMA-Factory
llamafactory-cli webui
vscode自带端口转发,不需要进行内网穿透了。
一定要在LLaMA-Factory 目录下启动。
模型准备
pip install modelscop #安装modelscope平台
sdk方式下载模型,同时可以查看模型整体的大小和权重。
模型微调,微调 Llama-3.2-1B-Instruct 模型