From 5b246ef89a2d92193bbccf8fdc7e042e16cb3b28 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Tue, 30 May 2023 10:31:49 +0800 Subject: [PATCH] Fix bug Signed-off-by: Jael Gu --- qa_prompt.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qa_prompt.py b/qa_prompt.py index bb5ad4e..a24724f 100644 --- a/qa_prompt.py +++ b/qa_prompt.py @@ -4,16 +4,14 @@ from typing import List, Tuple, Dict, Optional class QAPrompt: def __init__(self): super().__init__() - self._template = """ -'Use the following pieces of context to answer the question at the end. -If you don''t know the answer, just say that you don''t know, don''t try to make -up an answer. + self._template = """Use the following pieces of context to answer the question at the end. +If you don't know the answer, just say that you don't know, don't try to make up an answer. {context} Question: {question} -Helpful Answer:' +Helpful Answer: """ def __call__(self, question: str, docs: List[str], history=Optional[List[Tuple]]) -> List[Dict[str, str]]: @@ -30,4 +28,4 @@ Helpful Answer:' history_data = [] for item in history: history_data.append({'question': item[0], 'answer': item[1]}) - return history + ret + return history_data + ret