Spaces:
Paused
Paused
Upload Index.py
Browse files
Index.py
CHANGED
@@ -69,6 +69,9 @@ def initialize_vectorstore():
|
|
69 |
webpage_loader = WebBaseLoader("https://www.tredence.com/case-studies/tredence-helped-a-global-retailer-providing-holistic-campaign-analytics-by-using-the-power-of-gcp").load()
|
70 |
webpage_chunks = _text_splitter(webpage_loader)
|
71 |
|
|
|
|
|
|
|
72 |
# store embeddings in vector store
|
73 |
vectorstore = FAISS.from_documents(webpage_chunks, embedder)
|
74 |
print("vector store initialized with sample doc")
|
@@ -93,7 +96,7 @@ def _load_docs(path: str):
|
|
93 |
|
94 |
@app.get("/index/")
|
95 |
def get_domain_file_path(file_path: str):
|
96 |
-
print(file_path)
|
97 |
|
98 |
webpage_loader = _load_docs(file_path)
|
99 |
|
|
|
69 |
webpage_loader = WebBaseLoader("https://www.tredence.com/case-studies/tredence-helped-a-global-retailer-providing-holistic-campaign-analytics-by-using-the-power-of-gcp").load()
|
70 |
webpage_chunks = _text_splitter(webpage_loader)
|
71 |
|
72 |
+
global vectorstore
|
73 |
+
global retriever
|
74 |
+
|
75 |
# store embeddings in vector store
|
76 |
vectorstore = FAISS.from_documents(webpage_chunks, embedder)
|
77 |
print("vector store initialized with sample doc")
|
|
|
96 |
|
97 |
@app.get("/index/")
|
98 |
def get_domain_file_path(file_path: str):
|
99 |
+
print("file_path " ,file_path)
|
100 |
|
101 |
webpage_loader = _load_docs(file_path)
|
102 |
|