Handle multiline inputs
This commit is contained in:
parent
a35a2fab02
commit
8216c8f732
1 changed files with 5 additions and 3 deletions
|
@ -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:
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue