UKURIKIYEYEZU commited on
Commit
0052dfe
·
verified ·
1 Parent(s): ef18b52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -162,12 +162,12 @@ vectorstore.add_texts(processed_texts)
162
 
163
  from langchain_core.prompts import PromptTemplate
164
 
165
-
166
- template = ("""You are a legal expert specializing in providing precise and reliable legal assistance.
167
- Use the provided legal context to answer the question with clear and accurate legal advice.
168
- If the context is irrelevant or insufficient, state so concisely without elaboration.
169
- Do not discuss or analyze the context unless absolutely necessary for clarity.
170
- Ensure your response is professional, detailed in summary and rooted in legal reasoning
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
- demo.launch()
 
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%")