Spaces:
Sleeping
Sleeping
guangliang.yin commited on
Commit ·
bbba288
1
Parent(s): 944d0e1
类型优化
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ def web_loader(file, openai_key, puzhiai_key, zilliz_uri, user, password):
|
|
| 71 |
question_prompt = DEFAULT_TEXT_QA_PROMPT,
|
| 72 |
refine_prompt = DEFAULT_REFINE_PROMPT,
|
| 73 |
document_prompt = EXAMPLE_PROMPT,
|
| 74 |
-
verbose =
|
| 75 |
initial_chain = LLMChain(llm=llm, prompt=question_prompt, verbose=verbose)
|
| 76 |
_refine_llm = llm
|
| 77 |
refine_chain = LLMChain(llm=_refine_llm, prompt=refine_prompt, verbose=verbose)
|
|
@@ -84,7 +84,8 @@ def web_loader(file, openai_key, puzhiai_key, zilliz_uri, user, password):
|
|
| 84 |
verbose=verbose,
|
| 85 |
)
|
| 86 |
|
| 87 |
-
chain = RetrievalQAWithSourcesChain(combine_documents_chain=combine_documents_chain
|
|
|
|
| 88 |
return "success to load data"
|
| 89 |
|
| 90 |
|
|
@@ -105,7 +106,7 @@ if __name__ == "__main__":
|
|
| 105 |
"""
|
| 106 |
<h1><center>Langchain And Zilliz App</center></h1>
|
| 107 |
|
| 108 |
-
v.2.27.14.
|
| 109 |
|
| 110 |
"""
|
| 111 |
)
|
|
|
|
| 71 |
question_prompt = DEFAULT_TEXT_QA_PROMPT,
|
| 72 |
refine_prompt = DEFAULT_REFINE_PROMPT,
|
| 73 |
document_prompt = EXAMPLE_PROMPT,
|
| 74 |
+
verbose = None,
|
| 75 |
initial_chain = LLMChain(llm=llm, prompt=question_prompt, verbose=verbose)
|
| 76 |
_refine_llm = llm
|
| 77 |
refine_chain = LLMChain(llm=_refine_llm, prompt=refine_prompt, verbose=verbose)
|
|
|
|
| 84 |
verbose=verbose,
|
| 85 |
)
|
| 86 |
|
| 87 |
+
chain = RetrievalQAWithSourcesChain(combine_documents_chain=combine_documents_chain,
|
| 88 |
+
retriever=docsearch.as_retriever())
|
| 89 |
return "success to load data"
|
| 90 |
|
| 91 |
|
|
|
|
| 106 |
"""
|
| 107 |
<h1><center>Langchain And Zilliz App</center></h1>
|
| 108 |
|
| 109 |
+
v.2.27.14.38
|
| 110 |
|
| 111 |
"""
|
| 112 |
)
|