Update local_doc_qa.py
This commit is contained in:
parent
21362cd94c
commit
ec677beed0
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue