From e02cd7a488c8903f0c921d877e60d3a8e0da50bb Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 26 Jul 2024 15:45:18 +0800 Subject: [PATCH 1/4] update docker's readme --- README.md | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aaa28747..74b05c46 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,13 @@ To make it easier to use and save time on environment installation, we also prov docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2 # -p (port) -v (mount embedding and rerank model directories) -e (set environment variables, if using Dashscope LLM/Embedding, need to be introduced) -w (number of workers, can be specified as the approximate number of CPU cores) - docker run -p 8001:8001 -v /huggingface:/huggingface -e DASHSCOPE_API_KEY=sk-xxxx -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2 gunicorn -b 0.0.0.0:8001 -w 16 -k uvicorn.workers.UvicornH11Worker pai_rag.main:app + docker run --name pai_rag \ + -p 8001:8001 \ + -v /huggingface:/huggingface \ + -v /your_local_documents_path:/data \ + -e DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY} \ + -d \ + mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2 gunicorn -b 0.0.0.0:8001 -w 16 -k uvicorn.workers.UvicornH11Worker pai_rag.main:app ``` - GPU @@ -174,16 +180,39 @@ To make it easier to use and save time on environment installation, we also prov docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_gpu # -p (port) -v (mount embedding and rerank model directories) -e (set environment variables, if using Dashscope LLM/Embedding, you need to introduce it) -w (number of workers, which can be specified as the approximate number of CPU cores) - docker run -p 8001:8001 -v /huggingface:/huggingface --gpus all -e DASHSCOPE_API_KEY=sk-xxxx -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_gpu gunicorn -b 0.0.0.0:8001 -w 16 -k uvicorn.workers.UvicornH11Worker pai_rag.main:app + docker run --name pai_rag \ + -p 8001:8001 \ + -v /huggingface:/huggingface \ + -v /your_local_documents_path:/data \ + --gpus all \ + -e DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY} \ + -d \ + mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_gpu gunicorn -b 0.0.0.0:8001 -w 16 -k uvicorn.workers.UvicornH11Worker pai_rag.main:app ``` -2. RAG UI +2. Load Data + + Insert new files in the /data into the current index storage: + + ```bash + sudo docker exec -ti pai_rag bash + load_data -c src/pai_rag/config/settings.yaml -d /data -p pattern + ``` + + path examples: + + ``` + a. load_data -d /data/test/example + b. load_data -d /data/test/example_data/pai_document.pdf + c. load_data -d /data/test/example_data -p *.pdf + +3. RAG UI Linux: ```bash docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui -docker run --network host -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui +docker run -p 8002:8002 -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui ``` Mac/Windows: @@ -194,6 +223,8 @@ docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag: docker run -p 8002:8002 -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui pai_rag ui -p 8002 -c http://host.docker.internal:8001/ ``` +You can also open http://127.0.0.1:8002/ to configure the RAG service and upload local data. + ### Build your own image based on Dockerfile You can refer to [How to Build Docker](docs/docker_build.md) to build the image yourself. From a81293b2ab2fc3ed8b28b30a66abf285edfd40ee Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 26 Jul 2024 21:05:10 +0800 Subject: [PATCH 2/4] change network back --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 74b05c46..42c070f2 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ To make it easier to use and save time on environment installation, we also prov ```bash docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui -docker run -p 8002:8002 -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui +docker run -p --network host -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui ``` Mac/Windows: From 725960dac987a3783e8b688acf888c1a2d2e9c05 Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 26 Jul 2024 21:11:23 +0800 Subject: [PATCH 3/4] change network back --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 42c070f2..bcb9cbe1 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ To make it easier to use and save time on environment installation, we also prov a. load_data -d /data/test/example b. load_data -d /data/test/example_data/pai_document.pdf c. load_data -d /data/test/example_data -p *.pdf + ``` 3. RAG UI Linux: From 1743551e0a1086b0e097a6673999e9590736701c Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 26 Jul 2024 21:18:02 +0800 Subject: [PATCH 4/4] change network back --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bcb9cbe1..7e22e782 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ To make it easier to use and save time on environment installation, we also prov ```bash docker pull mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui -docker run -p --network host -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui +docker run --network host -d mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/mybigpai/pairag:0.0.2_ui ``` Mac/Windows: