本地知识库+本地大模型
更新: 2/10/2025 字数: 0 字 时长: 0 分钟
一 使用自带的 WSL 安装 Ubuntu-22.04 系统
1、启用window子系统及虚拟化
win + r 键入 OptionalFeatures,直接打开,开启
Hyper-V
、Windows虚拟机监控程序平台
、容器
、适用于Linux的Windows子系统
。
2、将wsl,升级为wsl2
bash
wsl --update #升级到最新版本(wsl2)
wsl --list --online # 查看所有可用的发行版
wsl --install -d Ubuntu-22.04 # 安装 Ubuntu-22.04 系统
wsl -l -v # 显示当前安装了哪些系统
wsl --set-default-version 2 #设置wsl默认版本为wsl2
wsl.exe --set-version Ubuntu-22.04 2 #设置Ubuntu-22.04为 wsl2
wsl.exe --set-version Ubuntu-22.04 1 #设置为wsl1
wsl -d Ubuntu-22.04 #登录到Ubuntu环境
wsl --shutdown Ubuntu-22.04 #关闭Ubuntu-22.04
wslconfig /list #查看wsl配置
wslconfig /setdefault Ubuntu-22.04 #设置默认的wsl系统
3、启动操作安装的linux
使用 wsl:在 cmd(或powershell)输入 wsl(或者:wsl -d Ubuntu-22.04)
bash
cat /etc/os-release #查看 Linux 的版本
# 设置时区命令
timedatectl
sudo timedatectl set-timezone Asia/Shanghai
timedatectl
二 安装win桌面版docker
win桌面版 地址: <www.docker.com/products/docker-desktop/>
三 部署启动ragflow
ragflow
仓库:https://github.com/infiniflow/ragflow/blob/main/README_zh.md
软硬件要求:
硬件:CPU ≥ 4 核 ; 内存≥ 16 GB; 磁盘空间 ≥ 50 GB; 软件:
Docker版本 ≥ 24.0.0 ;Docker Compose 版本 ≥ v2.26.1
bash
# 1 克隆仓库
git clone https://github.com/infiniflow/ragflow.git
# 2 使用Docker镜像启动服务器(45 GB左右,约2小时左右)
修改./docker/.env的45行,把HF_ENDPOINT 设成相应的镜像站点
HF_ENDPOINT=https://hf-mirror.com
cd ragflow/docker
chmod +x ./entrypoint.sh
docker compose -f docker-compose.yml up -d
# 3 确认服务器状态
docker logs -f ragflow-server
四 安装本地大模型LLM
安装ollama
(一步步点就行) 地址:https://www.ollama.com/
bash
ollama list #列出模型
ollama run qwen2:7b #下载运行模型
ollama rm #删除模型
ollama show #显示模型信息
下载Embedding
模型 说明:一个免费的中文的向量化模型
bash
ollama pull shaw/dmeta-embedding-zh
ollama list
最后用浏览器打开 http://localhost:11434
可以看到页面中显示:Ollama is running