fix: seed script accepts category as fallback for missing type field
This commit is contained in:
parent
f5c714d58c
commit
633478595b
@ -93,12 +93,12 @@ def parse_article(filepath: Path) -> dict | None:
|
|||||||
return m.group(1).strip() if m else ""
|
return m.group(1).strip() if m else ""
|
||||||
|
|
||||||
title = fm_get("title")
|
title = fm_get("title")
|
||||||
topic = fm_get("type")
|
topic = fm_get("type") or fm_get("category") or "analysis"
|
||||||
target_audience = fm_get("target_audience")
|
target_audience = fm_get("target_audience")
|
||||||
score_str = fm_get("score")
|
score_str = fm_get("score")
|
||||||
|
|
||||||
if not title or not topic or not body:
|
if not title or not body:
|
||||||
print(f" SKIP {filepath.name}: missing title/type/body")
|
print(f" SKIP {filepath.name}: missing title/body")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Build input_text: the generation request
|
# Build input_text: the generation request
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user