Skip to content

Commit 706f63a

Browse files
committed
fix extract_style_text_from_prompt #15132
1 parent eee46a5 commit 706f63a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/styles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def extract_style_text_from_prompt(style_text, prompt):
4242
stripped_style_text = style_text.strip()
4343

4444
if "{prompt}" in stripped_style_text:
45-
left, right = stripped_style_text.split("{prompt}", 2)
45+
left, _, right = stripped_style_text.partition("{prompt}")
4646
if stripped_prompt.startswith(left) and stripped_prompt.endswith(right):
4747
prompt = stripped_prompt[len(left):len(stripped_prompt)-len(right)]
4848
return True, prompt

0 commit comments

Comments
 (0)