Spaces:
Runtime error
Runtime error
Commit
•
e74d5aa
1
Parent(s):
a84d7a2
tool prompts optimized
Browse files- __pycache__/qaPipeline.cpython-311.pyc +0 -0
- qaPipeline.py +6 -6
__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,7 +226,7 @@ class QAPipeline:
|
|
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
|
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]"""
|
@@ -244,7 +244,7 @@ class QAPipeline:
|
|
244 |
general_qa_chain_tool = Tool(
|
245 |
name="general qa",
|
246 |
func= general_qa_chain.run,
|
247 |
-
description='''
|
248 |
Input should be a fully formed question.''',
|
249 |
return_direct=True,
|
250 |
|
@@ -252,7 +252,7 @@ class QAPipeline:
|
|
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.
|
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>>
|
@@ -299,8 +299,8 @@ class QAPipeline:
|
|
299 |
bank_regulations_qa_tool = Tool(
|
300 |
name="bank regulations",
|
301 |
func= lambda question: bank_regulations_qa({"question": question}),
|
302 |
-
description='''
|
303 |
-
|
304 |
return_direct=True,
|
305 |
)
|
306 |
|
@@ -309,7 +309,7 @@ class QAPipeline:
|
|
309 |
general_qa_chain_tool
|
310 |
]
|
311 |
|
312 |
-
prefix = """[INST]<<SYS>> Have a conversation with
|
313 |
suffix = """Begin! <</SYS>>"
|
314 |
|
315 |
{chat_history}
|
|
|
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 related to banking and financial sector. You should only continue the conversation and reply to users questions like welcomes, greetings and goodbyes.
|
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]"""
|
|
|
244 |
general_qa_chain_tool = Tool(
|
245 |
name="general qa",
|
246 |
func= general_qa_chain.run,
|
247 |
+
description='''use this when only you need to answer questions like welcomes, greetings and goodbyes.
|
248 |
Input should be a fully formed question.''',
|
249 |
return_direct=True,
|
250 |
|
|
|
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. Only answer questions related to Banking and Financial Services Sector like Banking & Financial regulations, legal framework, governance framework, compliance requirements as per Central Bank regulations.
|
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>>
|
|
|
299 |
bank_regulations_qa_tool = Tool(
|
300 |
name="bank regulations",
|
301 |
func= lambda question: bank_regulations_qa({"question": question}),
|
302 |
+
description='''Use this more when you need to answer questions about Banking and Financial Services Sector like Banking & Financial regulations, legal framework, governance framework, compliance requirements as per Central Bank regulations.
|
303 |
+
Input should be a fully formed question.''',
|
304 |
return_direct=True,
|
305 |
)
|
306 |
|
|
|
309 |
general_qa_chain_tool
|
310 |
]
|
311 |
|
312 |
+
prefix = """[INST]<<SYS>> You are the AI of company boardpac which provide services to company board members related to banking and financial sector. Have a conversation with the user, answering the following questions as best you can. You have access to the following tools:"""
|
313 |
suffix = """Begin! <</SYS>>"
|
314 |
|
315 |
{chat_history}
|