diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-06 13:21:12 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-06 13:21:12 +0300 |
commit | 2d3ea42a2d1e909bbccdb6b49561b187c60a9402 (patch) | |
tree | fb5fc96cccc10ff2ea9171cf13a8e3becd589119 /modules/prompt_parser.py | |
parent | 5f24b7bcf4a074fbdec757617fcd1bc82e76551b (diff) |
workaround for a mysterious bug where prompt weights can't be matched
Diffstat (limited to 'modules/prompt_parser.py')
-rw-r--r-- | modules/prompt_parser.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index a7a6aa31..f00256f2 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -156,7 +156,9 @@ def get_multicond_prompt_list(prompts): indexes = []
for subprompt in subprompts:
- text, weight = re_weight.search(subprompt).groups()
+ match = re_weight.search(subprompt)
+
+ text, weight = match.groups() if match is not None else (subprompt, 1.0)
weight = float(weight) if weight is not None else 1.0
|