From 8216c8f7329f98a135f1296ba1333eb3089b737a Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 7 May 2023 11:54:26 -0300 Subject: [PATCH] Handle multiline inputs --- extensions/superbig/script.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/superbig/script.py b/extensions/superbig/script.py index 3b915d87..dd264b24 100644 --- a/extensions/superbig/script.py +++ b/extensions/superbig/script.py @@ -125,10 +125,10 @@ def apply_settings(_chunk_count): def input_modifier(string): # Find the user input - pattern = re.compile(r"<\|begin-user-input\|>(.*?)<\|end-user-input\|>") + pattern = re.compile(r"<\|begin-user-input\|>(.*?)<\|end-user-input\|>", re.DOTALL) match = re.search(pattern, string) if match: - user_input = match.group(1) + user_input = match.group(1).strip() else: user_input = '' @@ -178,7 +178,9 @@ def ui(): <|injection-point|> ### Input: - <|begin-user-input|>What datasets are mentioned in the paper above?<|end-user-input|> + <|begin-user-input|> + What datasets are mentioned in the paper above? + <|end-user-input|> ### Response: ```