Stéphanie Kamgnia Wonkap commited on
Commit
4055a36
1 Parent(s): 23b3f51

fixing chat template

Browse files
Files changed (1) hide show
  1. src/generator.py +7 -9
src/generator.py CHANGED
@@ -9,15 +9,13 @@ from langchain_community.vectorstores import FAISS
9
  from langchain.chains.combine_documents import create_stuff_documents_chain
10
  from langchain.chains import create_retrieval_chain
11
  def promt_template():
12
- prompt_in_chat_format =(
13
- "Using the information contained in the given context, give a comprehensive answer to the question."
14
- "Respond only to the question asked, response should be concise and relevant to the question."
15
- "Provide the number of the source document when relevant.If the answer cannot be deduced from the context, do not give an answer. Please answer in french"
16
-
17
- "\n\n"
18
- "{context}"
19
- )
20
- prompt = ChatPromptTemplate.from_template(
21
  [
22
  ("system",prompt_in_chat_format),
23
  ("human", "{query}")
 
9
  from langchain.chains.combine_documents import create_stuff_documents_chain
10
  from langchain.chains import create_retrieval_chain
11
  def promt_template():
12
+ prompt_in_chat_format = """Using the information contained in the given context, give a comprehensive answer to the question.
13
+ Respond only to the question asked, response should be concise and relevant to the question.
14
+ Provide the number of the source document when relevant.If the answer cannot be deduced from the context, do not give an answer. Please answer in french
15
+ {context}
16
+ """
17
+
18
+ prompt = ChatPromptTemplate.from_messages(
 
 
19
  [
20
  ("system",prompt_in_chat_format),
21
  ("human", "{query}")