From 3364e5818bf65443a658ca159fbc844dc435fdd6 Mon Sep 17 00:00:00 2001 From: Shashank Date: Sat, 24 Jun 2023 04:18:33 +0530 Subject: [PATCH] Changed generate_prompt.py (#6644) Modified regex for Fix: ValueError: Could not parse output --- langchain/evaluation/qa/generate_prompt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/evaluation/qa/generate_prompt.py b/langchain/evaluation/qa/generate_prompt.py index 26d80b2153..a20defe530 100644 --- a/langchain/evaluation/qa/generate_prompt.py +++ b/langchain/evaluation/qa/generate_prompt.py @@ -18,7 +18,7 @@ These questions should be detailed and be based explicitly on information in the {doc} """ output_parser = RegexParser( - regex=r"QUESTION: (.*?)\nANSWER: (.*)", output_keys=["query", "answer"] + regex=r"QUESTION: (.*?)\n+ANSWER: (.*)", output_keys=["query", "answer"] ) PROMPT = PromptTemplate( input_variables=["doc"], template=template, output_parser=output_parser