Spaces:
Runtime error
Runtime error
Commit
·
d43825c
1
Parent(s):
2b391b7
update db
Browse files
app.py
CHANGED
|
@@ -259,6 +259,7 @@ def process_documents_2(ignored_files: List[str] = []) -> List[Document]:
|
|
| 259 |
|
| 260 |
def UpdateDb():
|
| 261 |
global vectordb_p
|
|
|
|
| 262 |
# pinecone.Index(index_name).delete(delete_all=True, namespace='')
|
| 263 |
# collection = vectordb_p.get()
|
| 264 |
# split_docs = process_documents([metadata['source'] for metadata in collection['metadatas']])
|
|
@@ -267,7 +268,7 @@ def UpdateDb():
|
|
| 267 |
tt = len(split_docs)
|
| 268 |
print(split_docs[tt-1])
|
| 269 |
print(f"Creating embeddings. May take some minutes...")
|
| 270 |
-
vectordb_p = Pinecone.from_documents(split_docs, embeddings, index_name =
|
| 271 |
print("Pinecone Updated Done")
|
| 272 |
print(index.describe_index_stats())
|
| 273 |
|
|
@@ -542,6 +543,7 @@ pinecone.init(
|
|
| 542 |
# openapi_config=openapi_config
|
| 543 |
)
|
| 544 |
# index_name = 'stla-baby'
|
|
|
|
| 545 |
index_name = 'stla-back'
|
| 546 |
index = pinecone.Index(index_name)
|
| 547 |
# index.delete(delete_all=True, namespace='')
|
|
@@ -1192,7 +1194,7 @@ with gr.Blocks() as demo:
|
|
| 1192 |
logs = gr.Textbox(max_lines = 25)
|
| 1193 |
|
| 1194 |
"""
|
| 1195 |
-
|
| 1196 |
"""
|
| 1197 |
|
| 1198 |
# upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
|
|
@@ -1351,6 +1353,7 @@ if __name__ == '__main__':
|
|
| 1351 |
# QAQuery_p("what is GST ?")
|
| 1352 |
# question = "what is PDP?"
|
| 1353 |
# output = asyncio.run(start_playwright(question))
|
|
|
|
| 1354 |
if SysLock == "1":
|
| 1355 |
demo.queue().launch(auth=(username, password), server_name="0.0.0.0", server_port=7860)
|
| 1356 |
else:
|
|
|
|
| 259 |
|
| 260 |
def UpdateDb():
|
| 261 |
global vectordb_p
|
| 262 |
+
global index_name
|
| 263 |
# pinecone.Index(index_name).delete(delete_all=True, namespace='')
|
| 264 |
# collection = vectordb_p.get()
|
| 265 |
# split_docs = process_documents([metadata['source'] for metadata in collection['metadatas']])
|
|
|
|
| 268 |
tt = len(split_docs)
|
| 269 |
print(split_docs[tt-1])
|
| 270 |
print(f"Creating embeddings. May take some minutes...")
|
| 271 |
+
vectordb_p = Pinecone.from_documents(split_docs, embeddings, index_name = index_name)
|
| 272 |
print("Pinecone Updated Done")
|
| 273 |
print(index.describe_index_stats())
|
| 274 |
|
|
|
|
| 543 |
# openapi_config=openapi_config
|
| 544 |
)
|
| 545 |
# index_name = 'stla-baby'
|
| 546 |
+
global index_name
|
| 547 |
index_name = 'stla-back'
|
| 548 |
index = pinecone.Index(index_name)
|
| 549 |
# index.delete(delete_all=True, namespace='')
|
|
|
|
| 1194 |
logs = gr.Textbox(max_lines = 25)
|
| 1195 |
|
| 1196 |
"""
|
| 1197 |
+
GUI Func
|
| 1198 |
"""
|
| 1199 |
|
| 1200 |
# upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
|
|
|
|
| 1353 |
# QAQuery_p("what is GST ?")
|
| 1354 |
# question = "what is PDP?"
|
| 1355 |
# output = asyncio.run(start_playwright(question))
|
| 1356 |
+
|
| 1357 |
if SysLock == "1":
|
| 1358 |
demo.queue().launch(auth=(username, password), server_name="0.0.0.0", server_port=7860)
|
| 1359 |
else:
|