-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker compose and update readme #288
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
environment: | ||
DASHSCOPE_API_KEY: ${DASHSCOPE_API_KEY} | ||
OSS_ACCESS_KEY_ID: ${OSS_ACCESS_KEY_ID} | ||
OSS_ACCESS_KEY_SECRET: ${OSS_ACCESS_KEY_SECRET} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
什么时候用环境变量,什么时候用配置还没特别理解,比如oss key设置了,bucket还要去控制台再设置一次,用户感觉是都是oss的配置,还要两个地方配置
我也没特别想好,可以讨论下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
包括用docker compose还是用helm,好像更近一步是不是更建议用helm?可以下一步计划里面
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
环境变量这个确实和控制台有重合。目前env不是required,感觉可以在这里写一下设置了环境变量,就不用在控制台输入这些key了。如果没设置,后面也可以在控制台手动输入。
docker compose主要是本地启动,helm确实更适合部署的时候,后面可以加一个helm的配置文件。
```bash | ||
# Support custom host (default 0.0.0.0), port (default 8001), config (default src/pai_rag/config/settings.yaml), skip-download-models (default False) | ||
# Download [bge-large-zh-v1.5, easyocr] by default, you can skip it by setting --skip-download-models. | ||
# you can use tool "load_model" to download other models including [bge-large-zh-v1.5, easyocr, SGPT-125M-weightedmean-nli-bitfit, bge-large-zh-v1.5, bge-m3, bge-reranker-base, bge-reranker-large, paraphrase-multilingual-MiniLM-L12-v2, qwen_1.8b, text2vec-large-chinese] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果已经load_model了,或者之前已经下载过了;是否会自动skip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果已经存在的模型,就会跳过,只下载本地没有的
pai_rag ui [--host HOST] [--port PORT] [rag-url RAG_URL] | ||
``` | ||
|
||
You can also open http://127.0.0.1:8002/ to configure the RAG service and upload local data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有的地方写了localhost,有的写了127.0.0.1
@@ -103,6 +103,10 @@ def index_url(self): | |||
def list_index_url(self): | |||
return f"{self.endpoint}v1/indexes" | |||
|
|||
@property | |||
def health_check_url(self): | |||
return f"{self.endpoint}health" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用urljoin代码会更健壮些,万一endpoint末尾没有以/结尾
- ./app_data:/app/localdata | ||
entrypoint: ["pai_rag", "serve"] | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8001/health"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所有的api,是不是加个版本号
/api/v1/health
- upload_data | ||
|
||
```bash | ||
curl -X 'POST' http://127.0.0.1:8000/service/upload_data -H 'Content-Type: multipart/form-data' -F 'files=@local_path/PAI.txt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
```bash | ||
# streaming output | ||
curl -X 'POST' http://127.0.0.1:8000/service/query -H "Content-Type: application/json" -d '{"question":"PAI是什么?", "stream":true}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文的示例里面,question用英文的好点,而且示例可以用通用点的,防止用户没用这种数据,出来的结果感觉不好
使用DashScope API,需要在命令行引入环境变量 | ||
|
||
```bash | ||
export DASHSCOPE_API_KEY="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export DASHSCOPE_API_KEY="xxx"
下面补充下请替换xxx为你自己的DASHSCOPE_API_KEY,DASHSCOPE_API_KEY获取地址为 https://dashscope.console.aliyun.com/apiKey
No description provided.