Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

update docker's readme #126

Merged
merged 4 commits into from
Jul 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -174,10 +180,34 @@ 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是漏掉了```

```

3. RAG UI
Linux:

```bash
Expand All @@ -194,6 +224,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.
Expand Down
Loading