- 激活环境
conda activate /root/share/pre_envs/pytorch2.1.2cu12.1
- 安装modelscope
pip install modelscope -t /root/envs/modelscope
pip install numpy==1.26.0 -t /root/envs/modelscope
pip install packaging -t /root/envs/modelscope
- 配置环境变量
export PATH=$PATH:/root/envs/modelscope/bin
export PYTHONPATH=/root/envs/modelscope:$PYTHONPATH
- 下载模型
//创建模型保存目录
mkdir -p /root/ms_model
//开始下载,下方命令演示下载其中的几个文件
modelscope download \
--model 'Shanghai_AI_Laboratory/internlm2_5-7b-chat' \
tokenizer_config.json config.json model.safetensors.index.json \
--local_dir '/root/ms_model'
- 如下图所示,下载成功