Update app.py
Browse files
app.py
CHANGED
|
@@ -95,6 +95,7 @@ def main():
|
|
| 95 |
|
| 96 |
st.header("Chat with multiple Lithuanian Law Documents:" ":books:")
|
| 97 |
|
|
|
|
| 98 |
st.markdown("Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations... ")
|
| 99 |
|
| 100 |
if "messages" not in st.session_state:
|
|
@@ -102,7 +103,7 @@ def main():
|
|
| 102 |
{"role": "assistant", "content": "Hi, I'm a chatbot who is based on respublic of Lithuania law documents. How can I help you?"}
|
| 103 |
]
|
| 104 |
|
| 105 |
-
|
| 106 |
search_type = st.selectbox(
|
| 107 |
"Choose search type. Options are [Max marginal relevance search (similarity) , Similarity search (similarity). Default value (mmr)]",
|
| 108 |
options=["mmr", "similarity"],
|
|
@@ -176,8 +177,9 @@ def create_conversational_rag_chain(retriever):
|
|
| 176 |
verbose=False,
|
| 177 |
)
|
| 178 |
|
| 179 |
-
template = """Answer the question in a natural language, based only on
|
| 180 |
{context}. Be consise.
|
|
|
|
| 181 |
|
| 182 |
Question: {question}
|
| 183 |
|
|
|
|
| 95 |
|
| 96 |
st.header("Chat with multiple Lithuanian Law Documents:" ":books:")
|
| 97 |
|
| 98 |
+
st.markdown("Hi, I am Birute (Powered by qwen2-1_5b model), chat assistant, based on republic of Lithuania law documents. You can choose below information retrieval type and how many documents you want to be retrieved.")
|
| 99 |
st.markdown("Available Documents: LR_Civil_Code_2022, LR_Constitution_2022, LR_Criminal_Code_2018, LR_Criminal_Procedure_code_2022,LR_Labour_code_2010. P.S it's a shame that there are no newest documents translations... ")
|
| 100 |
|
| 101 |
if "messages" not in st.session_state:
|
|
|
|
| 103 |
{"role": "assistant", "content": "Hi, I'm a chatbot who is based on respublic of Lithuania law documents. How can I help you?"}
|
| 104 |
]
|
| 105 |
|
| 106 |
+
|
| 107 |
search_type = st.selectbox(
|
| 108 |
"Choose search type. Options are [Max marginal relevance search (similarity) , Similarity search (similarity). Default value (mmr)]",
|
| 109 |
options=["mmr", "similarity"],
|
|
|
|
| 177 |
verbose=False,
|
| 178 |
)
|
| 179 |
|
| 180 |
+
template = """Answer the question in a natural English language, based only on context:
|
| 181 |
{context}. Be consise.
|
| 182 |
+
If you dont know the answer say: "Sorry, but i dont know the answer".
|
| 183 |
|
| 184 |
Question: {question}
|
| 185 |
|