harshitv804 commited on
Commit
d43e58f
1 Parent(s): fa5275c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -53,13 +53,14 @@ embeddings = HuggingFaceEmbeddings(model_name="nomic-ai/nomic-embed-text-v1",mod
53
  db = FAISS.load_local("ipc_vector_db", embeddings)
54
  db_retriever = db.as_retriever(search_type="similarity",search_kwargs={"k": 4})
55
 
56
- prompt_template = """This is a chat template and As a legal chat bot specializing in Indian Penal Code queries, your primary objective is to provide accurate and concise information based on the user's questions. Do not generate your own questions and answers. You will adhere strictly to the instructions provided, offering relevant context from the knowledge base while avoiding unnecessary details. Your responses will be brief, to the point, and in compliance with the established format. If a question falls outside the given context, you will refrain from utilizing the chat history and instead rely on your own knowledge base to generate an appropriate response. You will prioritize the user's query and refrain from posing additional questions. The aim is to deliver professional, precise, and contextually relevant information pertaining to the Indian Penal Code.
57
 
58
  CONTEXT: {context}
59
  CHAT HISTORY: {chat_history}
60
  QUESTION: {question}
61
 
62
  ANSWER:
 
63
  """
64
 
65
  prompt = PromptTemplate(template=prompt_template,
 
53
  db = FAISS.load_local("ipc_vector_db", embeddings)
54
  db_retriever = db.as_retriever(search_type="similarity",search_kwargs={"k": 4})
55
 
56
+ prompt_template = """<s>[INST]This is a chat template and As a legal chat bot specializing in Indian Penal Code queries, your primary objective is to provide accurate and concise information based on the user's questions. Do not generate your own questions and answers. You will adhere strictly to the instructions provided, offering relevant context from the knowledge base while avoiding unnecessary details. Your responses will be brief, to the point, and in compliance with the established format. If a question falls outside the given context, you will refrain from utilizing the chat history and instead rely on your own knowledge base to generate an appropriate response. You will prioritize the user's query and refrain from posing additional questions. The aim is to deliver professional, precise, and contextually relevant information pertaining to the Indian Penal Code.
57
 
58
  CONTEXT: {context}
59
  CHAT HISTORY: {chat_history}
60
  QUESTION: {question}
61
 
62
  ANSWER:
63
+ </s>[INST]
64
  """
65
 
66
  prompt = PromptTemplate(template=prompt_template,