Spaces:
Sleeping
Sleeping
updated to load the actual 10K file
Browse files- app.py +12 -12
- globals.py +2 -2
app.py
CHANGED
@@ -55,19 +55,19 @@ async def start():
|
|
55 |
print("\tsending message back: ready!!!")
|
56 |
|
57 |
content = ""
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
|
72 |
cl.user_session.set("message_history", [{"role": "system", "content": "You are a helpful assistant. "}])
|
73 |
await cl.Message(
|
|
|
55 |
print("\tsending message back: ready!!!")
|
56 |
|
57 |
content = ""
|
58 |
+
if _semantic_rag_chain is not None:
|
59 |
+
try:
|
60 |
+
response1 = _semantic_rag_chain.invoke({"question": DEFAULT_QUESTION1})
|
61 |
+
response2 = _semantic_rag_chain.invoke({"question": DEFAULT_QUESTION2})
|
62 |
|
63 |
+
content = (
|
64 |
+
f"**Question**: {DEFAULT_QUESTION1}\n\n"
|
65 |
+
f"{response1['response'].content}\n\n"
|
66 |
+
f"**Question**: {DEFAULT_QUESTION2}\n\n"
|
67 |
+
f"{response2['response'].content}\n\n"
|
68 |
+
)
|
69 |
+
except Exception as e:
|
70 |
+
_logger.error(f"init error: {e}")
|
71 |
|
72 |
cl.user_session.set("message_history", [{"role": "system", "content": "You are a helpful assistant. "}])
|
73 |
await cl.Message(
|
globals.py
CHANGED
@@ -16,7 +16,7 @@ DEFAULT_QUESTION2 = "Who are 'Directors' (i.e., members of the Board of Director
|
|
16 |
|
17 |
ROOT_PATH = "."
|
18 |
VECTOR_STORE_PATH = f"{ROOT_PATH}/data/qdrant"
|
19 |
-
|
20 |
-
META_10K_FILE_PATH = f"{ROOT_PATH}/data/meta-1pager.pdf"
|
21 |
META_SEMANTIC_COLLECTION = "meta10k-semantic"
|
22 |
|
|
|
16 |
|
17 |
ROOT_PATH = "."
|
18 |
VECTOR_STORE_PATH = f"{ROOT_PATH}/data/qdrant"
|
19 |
+
META_10K_FILE_PATH = f"{ROOT_PATH}/data/meta-10k-2023.pdf"
|
20 |
+
# META_10K_FILE_PATH = f"{ROOT_PATH}/data/meta-1pager.pdf"
|
21 |
META_SEMANTIC_COLLECTION = "meta10k-semantic"
|
22 |
|