Ritesh-hf commited on
Commit
f9cc0cb
1 Parent(s): 95ded7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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-17112024")
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, simply state that you don't know.
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
- - Then 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 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(