Add remaining samples, tooling, and local project assets
This commit is contained in:
48
run_mdx03_pipeline.py
Normal file
48
run_mdx03_pipeline.py
Normal file
@@ -0,0 +1,48 @@
|
||||
"""MDX 03을 기존 파이프라인으로 Stage 1.7까지 돌린 뒤, 산출물을 저장.
|
||||
|
||||
파이프라인 코드 그대로 사용:
|
||||
- Stage 0: mdx_normalizer
|
||||
- Stage 1A: kei_client.classify_content (Kei API)
|
||||
- Stage 1B: kei_client.refine_concepts + generate_structured_text
|
||||
- Stage 1.5a: space_allocator (컨테이너 계산 + font_hierarchy)
|
||||
- Stage 1.7: block_reference (블록 선택)
|
||||
|
||||
Stage 2(조립)는 여기서 하지 않음 — 산출물만 저장.
|
||||
"""
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
|
||||
from src.pipeline import generate_slide
|
||||
|
||||
|
||||
async def main():
|
||||
mdx_path = Path("samples/mdx/03. DX 시행을 위한 필수 요건 및 혁신 방안.mdx")
|
||||
content = mdx_path.read_text(encoding="utf-8")
|
||||
|
||||
print(f"MDX 03: {mdx_path.name}")
|
||||
print(f"내용 길이: {len(content)}자")
|
||||
print()
|
||||
|
||||
start = time.time()
|
||||
async for event in generate_slide(content, base_path=str(mdx_path.parent)):
|
||||
ev_type = event.get("event", "")
|
||||
data = event.get("data", "")
|
||||
if ev_type == "progress":
|
||||
print(f" {data}")
|
||||
elif ev_type == "result":
|
||||
elapsed = time.time() - start
|
||||
print(f"\n완료! ({elapsed:.1f}초)")
|
||||
if isinstance(data, dict):
|
||||
run_id = data.get("run_id", "")
|
||||
print(f"run_id: {run_id}")
|
||||
print(f"결과: data/runs/{run_id}/")
|
||||
elif ev_type == "error":
|
||||
print(f" 에러: {data}")
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user