debug
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ from langchain.chains.qa_with_sources import load_qa_with_sources_chain
|
|
14 |
# openai_key = f.read().strip()
|
15 |
# os.environ["OPENAI_API_KEY"] = openai_key
|
16 |
|
17 |
-
|
18 |
def get_docstore():
|
19 |
with open("data/acn_homepage_faiss_store_1000_tokens.pickle", "rb") as f:
|
20 |
store = pickle.load(f)
|
@@ -59,9 +59,9 @@ def init_chain():
|
|
59 |
|
60 |
# format the result to markdown format
|
61 |
def format_result_to_markdown(result: dict):
|
62 |
-
result_markdown = "
|
63 |
result_markdown += f"""
|
64 |
-
|
65 |
{result["output_text"].strip()}
|
66 |
"""
|
67 |
for i, intermediate_step in enumerate(result["intermediate_steps"]):
|
|
|
14 |
# openai_key = f.read().strip()
|
15 |
# os.environ["OPENAI_API_KEY"] = openai_key
|
16 |
|
17 |
+
|
18 |
def get_docstore():
|
19 |
with open("data/acn_homepage_faiss_store_1000_tokens.pickle", "rb") as f:
|
20 |
store = pickle.load(f)
|
|
|
59 |
|
60 |
# format the result to markdown format
|
61 |
def format_result_to_markdown(result: dict):
|
62 |
+
result_markdown = ""
|
63 |
result_markdown += f"""
|
64 |
+
**Answer**
|
65 |
{result["output_text"].strip()}
|
66 |
"""
|
67 |
for i, intermediate_step in enumerate(result["intermediate_steps"]):
|