mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
detailer: skip blank lines when building the fallback prompt pool
A blank spacer line between a [CLASS=...] line and a plain fallback line (common when formatting the prompt for readability) was being counted as an empty fallback entry, silently pushing the real fallback text out of position and handing untagged detections an empty prompt.
This commit is contained in:
@@ -50,6 +50,8 @@ def parse_prompt_lines(text: str):
|
||||
fallback: list[str] = []
|
||||
for line in (text or '').split('\n'):
|
||||
line = line.strip()
|
||||
if len(line) == 0:
|
||||
continue # blank spacer lines don't count as a fallback entry
|
||||
m = class_tag_re.match(line)
|
||||
if m:
|
||||
names = [n.strip().lower() for n in m.group(1).split(',') if n.strip()]
|
||||
|
||||
Reference in New Issue
Block a user