Update app.py
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ if query:
|
|
143 |
# if not os.path.exists(index_to_docstore_id_path):
|
144 |
# st.write(f"Missing: {index_to_docstore_id_path}")
|
145 |
|
146 |
-
st.write("Loading precomputed FAISS index and documents...")
|
147 |
index = faiss.read_index(index_path)
|
148 |
with open(docs_path, "rb") as f:
|
149 |
docs = pickle.load(f)
|
@@ -159,7 +159,7 @@ if query:
|
|
159 |
|
160 |
chain = RetrievalQAWithSourcesChain.from_llm(llm=llm, retriever=vector_store.as_retriever())
|
161 |
result = chain.invoke({"question": query}, return_only_outputs=True)
|
162 |
-
st.write(f"Raw result: {result}")
|
163 |
|
164 |
# Extract and display the result
|
165 |
answer = result.get("answer", "No answer found.")
|
|
|
143 |
# if not os.path.exists(index_to_docstore_id_path):
|
144 |
# st.write(f"Missing: {index_to_docstore_id_path}")
|
145 |
|
146 |
+
# st.write("Loading precomputed FAISS index and documents...")
|
147 |
index = faiss.read_index(index_path)
|
148 |
with open(docs_path, "rb") as f:
|
149 |
docs = pickle.load(f)
|
|
|
159 |
|
160 |
chain = RetrievalQAWithSourcesChain.from_llm(llm=llm, retriever=vector_store.as_retriever())
|
161 |
result = chain.invoke({"question": query}, return_only_outputs=True)
|
162 |
+
# st.write(f"Raw result: {result}")
|
163 |
|
164 |
# Extract and display the result
|
165 |
answer = result.get("answer", "No answer found.")
|