Update local_doc_qa.py

This commit is contained in:
imClumsyPanda 2023-04-21 21:21:11 +08:00
parent 21362cd94c
commit ec677beed0
1 changed files with 16 additions and 19 deletions

View File

@ -117,9 +117,6 @@ class LocalDocQA:
问题: 问题:
{question}""" {question}"""
if vs_path is None or vs_path =="":# or (not os.path.exists(vs_path))
result = self.llm.chat(query)
else:
prompt = PromptTemplate( prompt = PromptTemplate(
template=prompt_template, template=prompt_template,
input_variables=["context", "question"] input_variables=["context", "question"]
@ -136,7 +133,7 @@ class LocalDocQA:
) )
knowledge_chain.return_source_documents = True knowledge_chain.return_source_documents = True
result = knowledge_chain({"query": query}) result = knowledge_chain({"query": query})
self.llm.history[-1][0] = query self.llm.history[-1][0] = query
return result, self.llm.history return result, self.llm.history