Changed generate_prompt.py (#6644)

Modified regex for Fix: ValueError: Could not parse output
pull/6672/head
Shashank 1 year ago committed by GitHub
parent f1e1ac2a01
commit 3364e5818b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,7 +18,7 @@ These questions should be detailed and be based explicitly on information in the
{doc}
<End Document>"""
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

Loading…
Cancel
Save