尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

白盒蒸馏Qwen3-4B个人总结

白盒蒸馏Qwen3-4B个人总结 租用云服务器及配置环境pytorch安装pip install torch2.6.0torchvision0.21.0torchaudio2.6.0\--index-url https://download.pytorch.org/whl/cu124 \-i https://pypi.tuna.tsinghua.edu.cn/simple依赖安装库安装模型下载modelscope download--model Qwen/Qwen3-1.7B--local_dir/root/autodl-tmp/modelscope/Qwen3-1.7B模型路径/home/llama/train_output/train_20260802_lorascipy依赖与numpy1.26.4pip install scipy1.13.0--force-reinstall--no-cache-dir-i https://pypi.tuna.tsinghua.edu.cn/simplepytorchpip install-U torch torchvision torchaudio--index-url https://download.pytorch.org/whl/cu128库python-m pip install transformers peft accelerate datasets sentencepiece protobuf scipy-i https://pypi.tuna.tsinghua.edu.cn/simple--trusted-host pypi.tuna.tsinghua.edu.cntransformer库版本pip install transformers5.7.0-i https://pypi.tuna.tsinghua.edu.cn/simple流程1 lora训练保存模型到数据盘2 用Lora训练后的合并基座模型导出教师模型3 蒸馏出小模型4 推理小模型debug要看各个库的版本 防止冲突白盒蒸馏不用llama factory 用自己写代码 复习时理解train和推理代码的每一行了解仅Lora微调后的模型和合并模型的步骤 和文件形式及蒸馏的小模型保存位置Linux在指定路径运行文件 不然会报错
返回列表