mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 17:29:22 +01:00
Handle multiline inputs
This commit is contained in:
parent
a35a2fab02
commit
8216c8f732
@ -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…
Reference in New Issue
Block a user