* github: Add issue templates

* supports GPU usage in docker (#197)

* 上下文的prompt模版内容修改

---------

Co-authored-by: Calcitem <calcitem@outlook.com>
Co-authored-by: cocomany <124849750+cocomany@users.noreply.github.com>
Co-authored-by: glide-the <2533736852@qq.com>
This commit is contained in:
imClumsyPanda 2023-05-01 23:55:37 +08:00 committed by GitHub
parent 4df9d76f8a
commit 7a406e4263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -46,7 +46,7 @@ sudo systemctl restart docker
```
安装完成后,可以使用以下命令编译镜像和启动容器:
```
docker build -t chatglm-cuda:latest .
docker build -f Dockerfile-cuda -t chatglm-cuda:latest .
docker run --gpus all -d --name chatglm -p 7860:7860 chatglm-cuda:latest
#若要使用离线模型请配置好模型路径然后此repo挂载到Container

View File

@ -41,8 +41,14 @@ VS_ROOT_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "vector_
UPLOAD_ROOT_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "content", "")
# 基于上下文的prompt模版请务必保留"{question}"和"{context}"
PROMPT_TEMPLATE = """基于以下已知信息,简洁和专业的来回答用户的问题,问题是"{question}"。如果无法从中得到答案,请说 "根据已知信息无法回答该问题""没有提供足够的相关信息",不允许在答案中添加编造成分,答案请使用中文。已知内容如下:
{context} """
PROMPT_TEMPLATE = """已知信息在下方"="包裹的段落,基于以下已知信息,简洁和专业的来回答用户的问题。如果无法从中得到答案,请说 "根据已知信息无法回答该问题""没有提供足够的相关信息",不允许在答案中添加编造成分,答案请使用中文。
====================================已知信息=====================================================
{context}
================================================================================================
问题:"{question}"
答案:"""
# 匹配后单段上下文长度
CHUNK_SIZE = 500