Update app.py
Browse files
app.py
CHANGED
@@ -162,12 +162,12 @@ vectorstore.add_texts(processed_texts)
|
|
162 |
|
163 |
from langchain_core.prompts import PromptTemplate
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
If the context
|
169 |
-
|
170 |
-
|
171 |
|
172 |
Legal Context: {context}
|
173 |
|
@@ -175,9 +175,9 @@ template = ("""You are a legal expert specializing in providing precise and reli
|
|
175 |
|
176 |
Legal Advice:""")
|
177 |
|
178 |
-
|
179 |
rag_prompt = PromptTemplate.from_template(template)
|
180 |
|
|
|
181 |
retriever = vectorstore.as_retriever()
|
182 |
|
183 |
from langchain_core.output_parsers import StrOutputParser
|
@@ -261,4 +261,4 @@ demo = gr.ChatInterface(
|
|
261 |
)
|
262 |
|
263 |
if __name__ == "__main__":
|
264 |
-
|
|
|
162 |
|
163 |
from langchain_core.prompts import PromptTemplate
|
164 |
|
165 |
+
template = ("""Hello there! I'm your legal expert.
|
166 |
+
Let's dive right in. Feel free to ask your question.
|
167 |
+
You need to provide clear and accurate legal advice based on the context provided.
|
168 |
+
If the context isn't relevant or doesn't provide enough information, suggest how to proceed.
|
169 |
+
Stick to the answer directly.
|
170 |
+
Keep things professional but easy to understand, explaining everything in detail.
|
171 |
|
172 |
Legal Context: {context}
|
173 |
|
|
|
175 |
|
176 |
Legal Advice:""")
|
177 |
|
|
|
178 |
rag_prompt = PromptTemplate.from_template(template)
|
179 |
|
180 |
+
|
181 |
retriever = vectorstore.as_retriever()
|
182 |
|
183 |
from langchain_core.output_parsers import StrOutputParser
|
|
|
261 |
)
|
262 |
|
263 |
if __name__ == "__main__":
|
264 |
+
(share=True, inbrowser=True, height=800, width="100%")
|