Spaces:
Sleeping
Sleeping
Jakaria commited on
Commit ·
1cf02bf
1
Parent(s): 208eea1
Add Bangla model API
Browse files
rag.py
CHANGED
|
@@ -19,13 +19,24 @@ def build_chain():
|
|
| 19 |
|
| 20 |
llm = ChatGroq(model=GROQ_MODEL, api_key=GROQ_API_KEY, temperature=0.1)
|
| 21 |
|
| 22 |
-
#
|
| 23 |
chat_prompt = ChatPromptTemplate.from_messages([
|
| 24 |
SystemMessagePromptTemplate.from_template(
|
| 25 |
-
"You are a helpful
|
| 26 |
),
|
| 27 |
HumanMessagePromptTemplate.from_template(
|
| 28 |
-
"Context:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
)
|
| 30 |
])
|
| 31 |
|
|
|
|
| 19 |
|
| 20 |
llm = ChatGroq(model=GROQ_MODEL, api_key=GROQ_API_KEY, temperature=0.1)
|
| 21 |
|
| 22 |
+
# Combined system + human prompt
|
| 23 |
chat_prompt = ChatPromptTemplate.from_messages([
|
| 24 |
SystemMessagePromptTemplate.from_template(
|
| 25 |
+
"You are a helpful financial expert assistant with 10 years of experience. Use the context to answer."
|
| 26 |
),
|
| 27 |
HumanMessagePromptTemplate.from_template(
|
| 28 |
+
"""Context:
|
| 29 |
+
{context}
|
| 30 |
+
|
| 31 |
+
Question:
|
| 32 |
+
{question}
|
| 33 |
+
|
| 34 |
+
Answer the question clearly and concisely, and include a reference from the document.
|
| 35 |
+
For example:
|
| 36 |
+
Question: What is the purpose of the financial policy objectives and strategies statement?
|
| 37 |
+
Answer: The purpose of the financial policy objectives and strategies statement is to make transparent the Government’s financial strategies and to establish a benchmark for evaluating the Government’s conduct of financial policy.
|
| 38 |
+
Reference: page:5
|
| 39 |
+
"""
|
| 40 |
)
|
| 41 |
])
|
| 42 |
|