Handle multiline inputs

This commit is contained in:
oobabooga 2023-05-07 11:54:26 -03:00
parent a35a2fab02
commit 8216c8f732

View File

@ -125,10 +125,10 @@ def apply_settings(_chunk_count):
def input_modifier(string): def input_modifier(string):
# Find the user input # 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) match = re.search(pattern, string)
if match: if match:
user_input = match.group(1) user_input = match.group(1).strip()
else: else:
user_input = '' user_input = ''
@ -178,7 +178,9 @@ def ui():
<|injection-point|> <|injection-point|>
### Input: ### 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: ### Response:
``` ```