ubuntu 安装docker以及ragflow全教程
ubuntu 安装docker以及ragflow全教程

ubuntu 安装docker以及ragflow全教程

在Ubuntu上安装Docker和Ragflow(一个基于RAG(检索增强生成)技术的开源框架)的步骤可以分为几个部分。首先,我们将安装Docker,然后安装Ragflow。这里我将逐步指导你完成整个过程。

首先,更改 vm.max_map_count 值,设定为:=262144。

这个值的作用是允许Linux系统中,一个进程创建的最大内存映射区域数。如果应用程序需要创建的内存映射区域数超过了这个限制,就会导致映射失败,并可能出现性能问题或者直接导致应用程序崩溃。因此,对于依赖大量内存映射区域的应用程序(例如数据库系统、搜索引擎等),需要适当调整这个参数。

sudo sysctl -w vm.max_map_count=262144

步骤1:安装Docker

更新你的系统

打开终端,并更新你的系统包列表:

sudo apt update
sudo apt upgrade
安装Docker的依赖项
sudo apt install apt-transport-https ca-certificates curl software-properties-common
添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
添加Docker仓库到APT源中
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
再次更新你的包列表,并安装Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
启动并使Docker服务启动
sudo systemctl start docker
sudo systemctl enable docker
验证Docker是否正确安装
docker --version

步骤2:安装Ragflow

Ragflow不是一个单一的、官方的Docker镜像,因为它更多地是一个Python库,通常在Python环境中使用。但是,你可以在一个Docker容器中运行Python环境,然后在其中安装Ragflow。下面是如何做到这一点的步骤:

创建一个新的Docker容器(使用Python环境)
docker run -it --name ragflow_container python:3.8-slim bash

这将启动一个新的容器,并进入其bash shell。

在容器中安装Ragflow依赖项和Ragflow本身

首先,更新pip到最新版本(可选):

pip install --upgrade pip

然后,安装Ragflow的依赖项和Ragflow库:

pip install transformers datasets langchain sentence-transformers torch faiss-cpu python-dotenv openai tiktoken requests beautifulsoup4 unidecode nltk pandas numpy scikit-learn ipython jupyter jupyterlab ipywidgets matplotlib seaborn wordcloud tqdm pydantic pydantic[dotenv] openai-whisper langchain_experimental llama_index llama_cpp llama_cpp_python llama_index_chat llama_index_chat_tools llama_index_chat_examples llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama_index_chat_examples_tools llama Ragflow

(注意:这里可能需要替换为正确的pip安装命令或使用git克隆)

注意:上面的pip install命令中的Ragflow部分可能需要替换为正确的包名或使用git clone命令来从GitHub克隆Ragflow的仓库。例如,如果你知道正确的包名或仓库URL,可以直接使用它来安装。如果Ragflow不是一个独立的pip包,而是需要从源代码安装,你可以这样做:

git clone https://github.com/some-repo/ragflow.git # 用实际的仓库地址替换some-repo/ragflow.git
cd ragflow
pip install . # 或者使用 pip install -e . 如果要可编辑地安装(即在源码中修改)
退出容器(如果你完成了所有需要的操作)
exit

步骤3:运行Ragflow(在容器中)

要运行Ragflow代码,你可以再次启动容器并使用Python运行你的脚本:

docker start ragflow_container # 如果容器已经停止了的话,启动它。

 

浏览量: 47

发表回复