|
@@ -17,23 +17,24 @@ def get_prompt():
|
|
|
矢量数据库。通过对用户问题生成多个视角
|
|
|
目标是帮助用户克服基于距离的一些局限性
|
|
|
相似性搜索。请提供这些用换行符分隔的备选问题。
|
|
|
- 原始问题:{问题}""",
|
|
|
+ Original question: {question}""",
|
|
|
)
|
|
|
|
|
|
template = """仅根据以下上下文用中文回答问题:
|
|
|
{context},请严格以markdown格式输出并保障寄送格式正确无误,
|
|
|
Question: {question}
|
|
|
"""
|
|
|
+ # Question: {question}
|
|
|
|
|
|
- prompt = ChatPromptTemplate.from_template(template)
|
|
|
|
|
|
+ prompt = ChatPromptTemplate.from_template(template)
|
|
|
return QUERY_PROMPT, prompt
|
|
|
|
|
|
# Main function to handle the query process
|
|
|
def query(input):
|
|
|
if input:
|
|
|
# Initialize the language model with the specified model name
|
|
|
- llm = ChatOllama(model=LLM_MODEL)
|
|
|
+ llm = ChatOllama(model=LLM_MODEL,keep_alive=-1,num_ctx=32000,num_gpu=0)
|
|
|
# Get the vector database instance
|
|
|
db = get_vector_db()
|
|
|
# Get the prompt templates
|