Browse Source

small fix to COT prompt

Kai Wu 1 year ago
parent
commit
06d6be5f5d

+ 2 - 2
recipes/finetuning/datasets/raft_dataset.py

@@ -61,12 +61,12 @@ def raft_tokenize(q_a_pair, tokenizer):
     system_prompt = "You are a helpful chatbot who can provide an answer to every questions from the user given a relevant context."
     user_prompt = """
         Question: {question}\nContext: {context}\n
-        Answer this question using the information given by multiple documents in the context above. Here are things to pay attention to:
+        Answer this question using the information given by multiple documents in the context above. Here are the things to pay attention to:
         - The context contains many documents, each document starts with <DOCUMENT> and ends </DOCUMENT>.
         - First provide step-by-step reasoning on how to answer the question.
         - In the reasoning, if you need to copy paste some sentences from the context, include them in ##begin_quote## and ##end_quote##. This would mean that things outside of ##begin_quote## and ##end_quote## are not directly copy paste from the context.
         - End your response with final answer in the form <ANSWER>: $answer, the answer should less than 60 words.
-        You MUST begin your final answer with the tag "<ANSWER>
+        You MUST begin your final answer with the tag "<ANSWER>:".
     """.format(question=question, context=documents)
 
     chat = [

+ 2 - 2
recipes/use_cases/end2end-recipes/raft/raft.yaml

@@ -2,12 +2,12 @@ COT_prompt_template: >
   <|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a helpful chatbot who can provide an answer to every questions from the user given a relevant context.<|eot_id|>
   <|start_header_id|>user<|end_header_id|>
   Question: {question}\nContext: {context}\n
-  Answer this question using the information given by multiple documents in the context above. Here are things to pay attention to:
+  Answer this question using the information given by multiple documents in the context above. Here are the things to pay attention to:
   - The context contains many documents, each document starts with <DOCUMENT> and ends </DOCUMENT>.
   - First provide step-by-step reasoning on how to answer the question.
   - In the reasoning, if you need to copy paste some sentences from the context, include them in ##begin_quote## and ##end_quote##. This would mean that things outside of ##begin_quote## and ##end_quote## are not directly copy paste from the context.
   - End your response with final answer in the form <ANSWER>: $answer, the answer should less than 60 words.
-  You MUST begin your final answer with the tag "<ANSWER> <|eot_id|><|start_header_id|>assistant<|end_header_id|>
+  You MUST begin your final answer with the tag "<ANSWER>:". <|eot_id|><|start_header_id|>assistant<|end_header_id|>
 
 question_prompt_template: >
   <|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a synthetic question-answer pair generator. Given a chunk of context about

+ 2 - 2
recipes/use_cases/end2end-recipes/raft/raft_eval_config.yaml

@@ -22,12 +22,12 @@ RAG_prompt_template: >
   <|begin_of_text|><|start_header_id|>system<|end_header_id|> You are a helpful chatbot who can provide an answer to every questions from the user given a relevant context.<|eot_id|>
   <|start_header_id|>user<|end_header_id|>
   Question: {question}\nContext: {context}\n
-  Answer this question using the information given by multiple documents in the context above. Here are things to pay attention to:
+  Answer this question using the information given by multiple documents in the context above. Here are the things to pay attention to:
   - The context contains many documents, each document starts with <DOCUMENT> and ends </DOCUMENT>.
   - First provide step-by-step reasoning on how to answer the question.
   - In the reasoning, if you need to copy paste some sentences from the context, include them in ##begin_quote## and ##end_quote##. This would mean that things outside of ##begin_quote## and ##end_quote## are not directly copy paste from the context.
   - End your response with final answer in the form <ANSWER>: $answer, the answer should less than 60 words.
-  You MUST begin your final answer with the tag "<ANSWER> <|eot_id|><|start_header_id|>assistant<|end_header_id|>
+  You MUST begin your final answer with the tag "<ANSWER>:". <|eot_id|><|start_header_id|>assistant<|end_header_id|>
 eval_file: "./eval_llama.json"
 
 model_name: "raft-8b"