update parser

This commit is contained in:
Vladimir Mandic
2023-05-18 19:46:11 -04:00
parent 1c70056744
commit 527dc0eedf
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ def progressapi(req: ProgressRequest):
queued = req.id_task in pending_tasks
completed = req.id_task in finished_tasks
if not active:
return ProgressResponse(active=active, queued=queued, completed=completed, id_live_preview=-1, textinfo="In queue..." if queued else "Waiting...")
return ProgressResponse(active=active, queued=queued, completed=completed, id_live_preview=-1, textinfo="Queued..." if queued else "Waiting...")
progress = 0
job_count, job_no = shared.state.job_count, shared.state.job_no
sampling_steps, sampling_step = shared.state.sampling_steps, shared.state.sampling_step
+3 -1
View File
@@ -317,6 +317,7 @@ def parse_prompt_attention(text):
for m in re_attention.finditer(text):
text = m.group(0)
weight = m.group(1)
if text.startswith('\\'):
res.append([text[1:], 1.0])
elif text == '(':
@@ -326,7 +327,8 @@ def parse_prompt_attention(text):
elif weight is not None and len(round_brackets) > 0:
multiply_range(round_brackets.pop(), float(weight))
elif weight is not None and len(square_brackets) > 0:
multiply_range(square_brackets.pop(), float(weight))
if opts.prompt_attention == 'Full parser':
multiply_range(square_brackets.pop(), float(weight))
elif text == ')' and len(round_brackets) > 0:
multiply_range(round_brackets.pop(), round_bracket_multiplier)
elif text == ']' and len(square_brackets) > 0: