安装lora微调大模型

  1. 打开终端(在Unix或macOS上)或命令提示符/Anaconda Prompt(在Windows上)。

  2. 创建一个名为lora的虚拟环境并指定Python版本为3.9。

conda create --name lora python=3.9
  1. 激活新创建的虚拟环境。

conda activate lora
  1. 克隆项目。

git clone https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
  1. 安装Python依赖项。由于您已经有了依赖项的列表,您可以使用pip来安装它们。

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 
pip install transformers_stream_generator bitsandbytes tiktoken auto-gptq optimum autoawq -i https://pypi.tuna.tsinghua.edu.cn/simple 
pip install --upgrade tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple 

  1. 运行代码。

CUDA_VISIBLE_DEVICES=0 USE_MODELSCOPE_HUB=1 python src/webui.py
  1. 当您完成工作后,您可以停用虚拟环境。

llamafactory-cli train cust/train_llama3_lora_sft.yaml

conda deactivate

请确保您已经有了conda命令行工具,并且已经添加到您的系统环境变量中。如果您还没有安装conda,您可以从AnacondaMiniconda官网下载并安装。

请注意,如果您在安装过程中遇到任何依赖性问题,您可能需要根据错误信息调整包的版本或安装顺序。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值