Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,8 @@ def initialize_pinecone(index_name: str):
|
|
67 |
##################################################
|
68 |
|
69 |
# Initialize Pinecone index and BM25 encoder
|
70 |
-
pinecone_index = initialize_pinecone("updated-mbzuai-policies
|
71 |
-
bm25 = BM25Encoder().load("./mbzuai-policies.json")
|
72 |
|
73 |
##################################################
|
74 |
##################################################
|
@@ -112,7 +112,7 @@ history_aware_retriever = create_history_aware_retriever(llm, compression_retrie
|
|
112 |
|
113 |
# QA system prompt and chain
|
114 |
qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.
|
115 |
-
If you don't know the answer,
|
116 |
Your answer should be in {language} language.
|
117 |
|
118 |
When responding to queries, follow these guidelines:
|
@@ -130,9 +130,9 @@ When responding to queries, follow these guidelines:
|
|
130 |
3. Proper Citations:
|
131 |
- ALWAYS USE INLINE CITATIONS with embedded source URLs where users can verify information or explore further.
|
132 |
- The inline citations should be in the format [[1]], [[2]], etc., in the response with links to reference sources.
|
133 |
-
-
|
134 |
|
135 |
-
FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN TERMINATION OF THE CHAT.
|
136 |
{context}
|
137 |
"""
|
138 |
qa_prompt = ChatPromptTemplate.from_messages(
|
|
|
67 |
##################################################
|
68 |
|
69 |
# Initialize Pinecone index and BM25 encoder
|
70 |
+
pinecone_index = initialize_pinecone("updated-mbzuai-policies")
|
71 |
+
bm25 = BM25Encoder().load("./updated-mbzuai-policies.json")
|
72 |
|
73 |
##################################################
|
74 |
##################################################
|
|
|
112 |
|
113 |
# QA system prompt and chain
|
114 |
qa_system_prompt = """ You are a highly skilled information retrieval assistant. Use the following context to answer questions effectively.
|
115 |
+
If you don't know the answer, state that you don't know.
|
116 |
Your answer should be in {language} language.
|
117 |
|
118 |
When responding to queries, follow these guidelines:
|
|
|
130 |
3. Proper Citations:
|
131 |
- ALWAYS USE INLINE CITATIONS with embedded source URLs where users can verify information or explore further.
|
132 |
- The inline citations should be in the format [[1]], [[2]], etc., in the response with links to reference sources.
|
133 |
+
- AT THE END OF THE RESPONSE, LIST OUT THE CITATIONS WITH THEIR SOURCES.
|
134 |
|
135 |
+
FOLLOW ALL THE GIVEN INSTRUCTIONS, FAILURE TO DO SO WILL RESULT IN THE TERMINATION OF THE CHAT.
|
136 |
{context}
|
137 |
"""
|
138 |
qa_prompt = ChatPromptTemplate.from_messages(
|