基于Windows11的WSL2通过Ollama平台安装部署DeepSeek-R1模型
按住输入打开命令行systeminfo看到如下字样,代表电脑已经支持虚拟化,可继续安装在中搜索“开发者设置”并打开;打开并点击开启“适用于Linux的Windows子系统”打开,选中“适用于Linux的Windows子系统”,然后点击使用管理员打开power shell。
DeepSeek-R1模型各参数版本硬件要求

一、在Windows上安装Linux子系统WSL2
- 检查电脑是否支持虚拟化,按住
<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">Windows+R</font>输入<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">cmd</font>打开命令行
systeminfo
看到如下字样,代表电脑已经支持虚拟化,可继续安装

- 开启开发者模式
在<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">设置</font>中搜索“开发者设置”并打开;

- 打开
<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">开发人员模式</font>并点击<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">是</font>

- 开启“适用于Linux的Windows子系统”
打开<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">控制面板</font>-<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">程序和功能</font>-<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">启用或关闭Windows功能</font>,选中“适用于Linux的Windows子系统”,然后点击<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">确定</font>


- 更新wsl
wsl --update
- 设置wsl默认版本
使用管理员打开power shell
wsl --set-default-version 2
二、安装ubuntu
- 打开
<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">微软商店(Microsoft Store)</font>搜索“Ubuntu”,然后选择<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">Ubuntu24.04 LTS</font>点击安装,直到下载完成为止;

我们可以在<font style="color:rgb(199, 37, 78);background-color:rgb(249, 242, 244);">开始</font>菜单中看到Ubuntu20.04的图标:
2. 双击打开可以看到注册账户的信息,根据个人习惯输入账户名称和密码即可。
登录后显示如下

- 更新apt组件
sudo apt update

sudo apt upgrade

三、安装pip
- 安装
sudo apt install python3-pip

- 查看pip版本,确认安装成功
pip3 --version

四、安装modelscope
- 安装组件venv
apt install python3.10-venv

- 创建python独立工作空间modelscope-env
python3 -m venv modelscope-env
- 激活modelscope-env
source modelscope-env/bin/activate

- 安装modelscope
pip install -i https://mirrors.aliyun.com/pypi/simple/ modelscope
五、安装ollama-linux
- 安装初始化组件
pip install -i https://mirrors.aliyun.com/pypi/simple/ --upgrade setuptools

- 下载ollama-linux
modelscope download --model=modelscope/ollama-linux --local_dir ./ollama-linux --revision v0.5.8
- 进入ollama-linux文件夹
cd ollama-linux/

- 给ollama-modelscope-install.sh赋权
sudo chmod 777 ./ollama-modelscope-install.sh
- 运行ollama-modelscope-install.sh脚本
./ollama-modelscope-install.sh
- 启动ollama
ollama serve
六、安装deepseek R1
- 登录ollama网站,选择Models

- 选择对应的模型下载命令

ollama run deepseek-r1:1.5b

更多推荐



所有评论(0)