Skip to content

Commit 2d3ea42

Browse files
committed
workaround for a mysterious bug where prompt weights can't be matched
1 parent 5f24b7b commit 2d3ea42

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎modules/prompt_parser.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ def get_multicond_prompt_list(prompts):
156156

157157
indexes = []
158158
for subprompt in subprompts:
159-
text, weight = re_weight.search(subprompt).groups()
159+
match = re_weight.search(subprompt)
160+
161+
text, weight = match.groups() if match is not None else (subprompt, 1.0)
160162

161163
weight = float(weight) if weight is not None else 1.0
162164

0 commit comments

Comments
 (0)