Spaces:
Sleeping
Sleeping
guangliang.yin commited on
Commit ·
1ac8142
1
Parent(s): 40cdb6a
add log 2 bugfix
Browse files
app.py
CHANGED
|
@@ -21,6 +21,10 @@ def web_loader(url_list, openai_key, zilliz_uri, user, password):
|
|
| 21 |
docs = text_splitter.split_documents(docs)
|
| 22 |
embeddings = OpenAIEmbeddings(model="ada", openai_api_key=openai_key)
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
docsearch = Zilliz.from_documents(
|
| 25 |
docs,
|
| 26 |
embedding=embeddings,
|
|
@@ -32,6 +36,10 @@ def web_loader(url_list, openai_key, zilliz_uri, user, password):
|
|
| 32 |
},
|
| 33 |
)
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
global chain
|
| 36 |
chain = RetrievalQAWithSourcesChain.from_chain_type(
|
| 37 |
OpenAI(temperature=0, openai_api_key=openai_key),
|
|
|
|
| 21 |
docs = text_splitter.split_documents(docs)
|
| 22 |
embeddings = OpenAIEmbeddings(model="ada", openai_api_key=openai_key)
|
| 23 |
|
| 24 |
+
if not embeddings:
|
| 25 |
+
return "embeddings not"
|
| 26 |
+
print("计算向量结果:", embeddings)
|
| 27 |
+
|
| 28 |
docsearch = Zilliz.from_documents(
|
| 29 |
docs,
|
| 30 |
embedding=embeddings,
|
|
|
|
| 36 |
},
|
| 37 |
)
|
| 38 |
|
| 39 |
+
if not docsearch:
|
| 40 |
+
return "docsearch not"
|
| 41 |
+
print("docsearch结果:", docsearch)
|
| 42 |
+
|
| 43 |
global chain
|
| 44 |
chain = RetrievalQAWithSourcesChain.from_chain_type(
|
| 45 |
OpenAI(temperature=0, openai_api_key=openai_key),
|