Spaces:
Sleeping
Sleeping
guangliang.yin
commited on
Commit
•
2c97b5a
1
Parent(s):
1a58e38
优化提示词
Browse files
app.py
CHANGED
@@ -89,7 +89,16 @@ def web_loader(file, openai_key, puzhiai_key, zilliz_uri, user, password):
|
|
89 |
# The prompt here should take as an input variable the
|
90 |
# `document_variable_name`
|
91 |
prompt = PromptTemplate.from_template(
|
92 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
)
|
94 |
llm_chain = LLMChain(llm=llm, prompt=prompt)
|
95 |
combine_documents_chain = StuffDocumentsChain(
|
|
|
89 |
# The prompt here should take as an input variable the
|
90 |
# `document_variable_name`
|
91 |
prompt = PromptTemplate.from_template(
|
92 |
+
"""用提供给你的文档去回答问题,不需要编造或者虚构答案,也不需要回答文档之外的内容。
|
93 |
+
如果在文档中没有找到相关的答案,那么就直接回答'知识库中没有相关问题解答'
|
94 |
+
请用中文回答。
|
95 |
+
下边是我给你提供的文档,其中文档格式都是一问一答。问题答案也完全来自所提供的回答:
|
96 |
+
---------------------
|
97 |
+
{context}
|
98 |
+
---------------------
|
99 |
+
|
100 |
+
问题: {question}
|
101 |
+
答:"""
|
102 |
)
|
103 |
llm_chain = LLMChain(llm=llm, prompt=prompt)
|
104 |
combine_documents_chain = StuffDocumentsChain(
|