reranker.md优化docker启动命令,并增加docker-compose.yml示例 (#936)
Some checks failed
deploy-docs / deploy-production (push) Has been cancelled
Build docs images and copy image to docker hub / build-fastgpt-docs-images (push) Has been cancelled
Build docs images and copy image to docker hub / push-to-docker-hub (push) Has been cancelled
Build docs images and copy image to docker hub / update-docs-image (push) Has been cancelled

原docker启动命令启动后的容器只能使用CPU运行。本次修改增加了GPU参数,并提供docker-compose.yml示例
This commit is contained in:
John Chen 2024-03-06 18:13:55 +08:00 committed by GitHub
parent af581bc903
commit b74dd2341b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,11 +54,37 @@ ACCESS_TOKEN=mytoken
```
**运行命令示例**
- 无需GPU环境使用CPU运行
```sh
docker run -d --name reranker -p 6006:6006 -e ACCESS_TOKEN=mytoken luanshaotong/reranker:v0.1
```
- 需要CUDA 11.7环境
```sh
docker run -d --gpus all --name reranker -p 6006:6006 -e ACCESS_TOKEN=mytoken luanshaotong/reranker:v0.1
```
**docker-compose.yml示例**
```
version: "3"
services:
reranker:
image: luanshaotong/reranker:v0.1
container_name: reranker
# GPU运行环境如果宿主机未安装将deploy配置隐藏即可
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
ports:
- 6006:6006
environment:
- ACCESS_TOKEN=mytoken
```
## 接入 FastGPT
参考 [ReRank模型接入](/docs/development/configuration/#rerank-接入)host 变量为部署的域名。