Spaces:
Sleeping
Sleeping
guangliang.yin
commited on
Commit
•
08e79a1
1
Parent(s):
efc8163
优化UI
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def web_loader(file, openai_key, puzhiai_key, zilliz_uri, user, password):
|
|
45 |
global chain
|
46 |
chain = RetrievalQAWithSourcesChain.from_chain_type(
|
47 |
ZhipuAILLM(model="glm-3-turbo", temperature=0.1, zhipuai_api_key=puzhiai_key),
|
48 |
-
chain_type="
|
49 |
retriever=docsearch.as_retriever(),
|
50 |
)
|
51 |
return "success to load data"
|
@@ -66,26 +66,10 @@ if __name__ == "__main__":
|
|
66 |
with block as demo:
|
67 |
gr.Markdown(
|
68 |
"""
|
69 |
-
<h1><center>Langchain And Zilliz
|
70 |
-
This is how to use Zilliz Cloud as vector store in LangChain.
|
71 |
-
The purpose of this example is to allow you to input multiple URLs (separated by newlines) and then ask questions about the content of the corresponding web pages.
|
72 |
|
73 |
-
v.2.27.
|
74 |
|
75 |
-
## 📋 Prerequisite:
|
76 |
-
|
77 |
-
1. 🔑 To obtain an OpenAI key, please visit https://platform.openai.com/account/api-keys.
|
78 |
-
2. 💻 Create a Zilliz Cloud account to get free credits for usage by visiting https://cloud.zilliz.com.
|
79 |
-
3. 🗄️ Create a database in Zilliz Cloud.
|
80 |
-
|
81 |
-
## 📝 Steps for usage:
|
82 |
-
|
83 |
-
1. 🖋️ Fill in the url list input box with multiple URLs.
|
84 |
-
2. 🔑 Fill in the OpenAI API key in the openai api key input box.
|
85 |
-
3. 🌩️ Fill in the Zilliz Cloud connection parameters, including the connection URL, corresponding username, and password.
|
86 |
-
4. 🚀 Click the Load Data button to load the data. When the load status text box prompts that the data has been successfully loaded, proceed to the next step.
|
87 |
-
5. ❓ In the question input box, enter the relevant question about the web page.
|
88 |
-
6. 🔍 Click the Generate button to search for the answer to the question. The final answer will be displayed in the question answer text box.
|
89 |
"""
|
90 |
)
|
91 |
# url_list_text = gr.Textbox(
|
|
|
45 |
global chain
|
46 |
chain = RetrievalQAWithSourcesChain.from_chain_type(
|
47 |
ZhipuAILLM(model="glm-3-turbo", temperature=0.1, zhipuai_api_key=puzhiai_key),
|
48 |
+
chain_type="refine",
|
49 |
retriever=docsearch.as_retriever(),
|
50 |
)
|
51 |
return "success to load data"
|
|
|
66 |
with block as demo:
|
67 |
gr.Markdown(
|
68 |
"""
|
69 |
+
<h1><center>Langchain And Zilliz App</center></h1>
|
|
|
|
|
70 |
|
71 |
+
v.2.27.11.21
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
"""
|
74 |
)
|
75 |
# url_list_text = gr.Textbox(
|