Skip to content

Commit

Permalink
Merge pull request #6628 from catboxanon/fix/alternating-words-emphasis
Browse files Browse the repository at this point in the history
Fix prompt parser default step transformer
  • Loading branch information
AUTOMATIC1111 committed Jan 11, 2023
2 parents 4bd4907 + 0b38b72 commit 97ff69e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/prompt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def get_learned_conditioning_prompt_schedules(prompts, steps):
[[5, 'a c'], [10, 'a {b|d{ c']]
>>> g("((a][:b:c [d:3]")
[[3, '((a][:b:c '], [10, '((a][:b:c d']]
>>> g("[a|(b:1.1)]")
[[1, 'a'], [2, '(b:1.1)'], [3, 'a'], [4, '(b:1.1)'], [5, 'a'], [6, '(b:1.1)'], [7, 'a'], [8, '(b:1.1)'], [9, 'a'], [10, '(b:1.1)']]
"""

def collect_steps(steps, tree):
Expand Down Expand Up @@ -84,7 +86,7 @@ def plain(self, args):
yield args[0].value
def __default__(self, data, children, meta):
for child in children:
yield from child
yield child
return AtStep().transform(tree)

def get_schedule(prompt):
Expand Down

0 comments on commit 97ff69e

Please sign in to comment.