theekshana commited on
Commit
a84d7a2
1 Parent(s): ed7f5c7

prompt stop tokens added

Browse files
__pycache__/config.cpython-311.pyc CHANGED
Binary files a/__pycache__/config.cpython-311.pyc and b/__pycache__/config.cpython-311.pyc differ
 
__pycache__/faissDb.cpython-311.pyc CHANGED
Binary files a/__pycache__/faissDb.cpython-311.pyc and b/__pycache__/faissDb.cpython-311.pyc differ
 
__pycache__/qaPipeline.cpython-311.pyc CHANGED
Binary files a/__pycache__/qaPipeline.cpython-311.pyc and b/__pycache__/qaPipeline.cpython-311.pyc differ
 
qaPipeline.py CHANGED
@@ -226,10 +226,10 @@ class QAPipeline:
226
 
227
  # Define a custom prompt
228
  general_qa_template = (
229
- """You are the AI of company boardpac which provide services to company board members. You can have a general conversation with the users like greetings. Continue the conversation and only answer questions related to banking sector like financial and legal.
230
- If you dont know the answer say you dont know, dont try to makeup answers. Start the answer with code word Boardpac AI (chat):
231
  Conversation: {chat_history}
232
- Question: {question}"""
233
  )
234
 
235
  general_qa_chain_prompt = PromptTemplate(input_variables=["question", "chat_history"], template=general_qa_template)
@@ -252,13 +252,13 @@ class QAPipeline:
252
 
253
  # Define a custom prompt
254
  retrieval_qa_template = (
255
- """You are the AI of company boardpac which provide services to company board members.You can have a general conversation with the users like greetings. Continue the conversation and only answer questions related to banking sector like financial and legal.
256
  please answer the question based on the chat history and context information provided below related to central bank acts published in various years. The published year is mentioned as the metadata 'year' of each source document.
257
  The content of a bank act of a past year can updated by a bank act from a latest year. Always try to answer with latest information and mention the year which information extracted.
258
- If you dont know the answer say you dont know, dont try to makeup answers.Start the answer with code word Boardpac AI (QA):
259
  Conversation: {chat_history}
260
  Context: {context}
261
- Question : {question}"""
262
  )
263
 
264
  retrieval_qa_chain_prompt = PromptTemplate(
@@ -309,12 +309,12 @@ class QAPipeline:
309
  general_qa_chain_tool
310
  ]
311
 
312
- prefix = """Have a conversation with a human, answering the following questions as best you can. You have access to the following tools:"""
313
- suffix = """Begin!"
314
 
315
  {chat_history}
316
  Question: {question}
317
- {agent_scratchpad}"""
318
 
319
  agent_prompt = ZeroShotAgent.create_prompt(
320
  tools,
 
226
 
227
  # Define a custom prompt
228
  general_qa_template = (
229
+ """[INST]<<SYS>> You are the AI of company boardpac which provide services to company board members. You can have a general conversation with the users like greetings. Continue the conversation and only answer questions related to banking sector like financial and legal.
230
+ If you dont know the answer say you dont know, dont try to makeup answers. Start the answer with code word Boardpac AI (chat): <</SYS>>
231
  Conversation: {chat_history}
232
+ Question: {question} [/INST]"""
233
  )
234
 
235
  general_qa_chain_prompt = PromptTemplate(input_variables=["question", "chat_history"], template=general_qa_template)
 
252
 
253
  # Define a custom prompt
254
  retrieval_qa_template = (
255
+ """[INST]<<SYS>> You are the AI of company boardpac which provide services to company board members.You can have a general conversation with the users like greetings. Continue the conversation and only answer questions related to banking sector like financial and legal.
256
  please answer the question based on the chat history and context information provided below related to central bank acts published in various years. The published year is mentioned as the metadata 'year' of each source document.
257
  The content of a bank act of a past year can updated by a bank act from a latest year. Always try to answer with latest information and mention the year which information extracted.
258
+ If you dont know the answer say you dont know, dont try to makeup answers.Start the answer with code word Boardpac AI (QA): <</SYS>>
259
  Conversation: {chat_history}
260
  Context: {context}
261
+ Question : {question} [/INST]"""
262
  )
263
 
264
  retrieval_qa_chain_prompt = PromptTemplate(
 
309
  general_qa_chain_tool
310
  ]
311
 
312
+ prefix = """[INST]<<SYS>> Have a conversation with a human, answering the following questions as best you can. You have access to the following tools:"""
313
+ suffix = """Begin! <</SYS>>"
314
 
315
  {chat_history}
316
  Question: {question}
317
+ {agent_scratchpad} [/INST]"""
318
 
319
  agent_prompt = ZeroShotAgent.create_prompt(
320
  tools,