fix
Browse files- app.py +7 -7
- pipeline.py +3 -3
app.py
CHANGED
|
@@ -55,7 +55,7 @@ RUNS_DIR = ROOT / "runs" # all per-run workspaces live here
|
|
| 55 |
RUNS_DIR.mkdir(parents=True, exist_ok=True)
|
| 56 |
|
| 57 |
TIMEOUT_SECONDS = 1800 # 30 minutes
|
| 58 |
-
RETENTION_HOURS =
|
| 59 |
|
| 60 |
# ---------------------
|
| 61 |
# Utils
|
|
@@ -375,12 +375,12 @@ def run_pipeline(arxiv_url, pdf_file, openai_key, logo_files, meeting_logo_file,
|
|
| 375 |
logo_files = [logo_files]
|
| 376 |
logo_files = [f for f in logo_files if f]
|
| 377 |
|
| 378 |
-
if len(logo_files) == 0:
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
|
| 385 |
# Save logos into run-local dir
|
| 386 |
for item in LOGO_DIR.iterdir():
|
|
|
|
| 55 |
RUNS_DIR.mkdir(parents=True, exist_ok=True)
|
| 56 |
|
| 57 |
TIMEOUT_SECONDS = 1800 # 30 minutes
|
| 58 |
+
RETENTION_HOURS = 1 # auto-clean runs older than N hours
|
| 59 |
|
| 60 |
# ---------------------
|
| 61 |
# Utils
|
|
|
|
| 375 |
logo_files = [logo_files]
|
| 376 |
logo_files = [f for f in logo_files if f]
|
| 377 |
|
| 378 |
+
# if len(logo_files) == 0:
|
| 379 |
+
# msg = "❌ You must upload at least one institutional logo (multiple allowed)."
|
| 380 |
+
# logs.append(msg)
|
| 381 |
+
# _write_logs(LOG_PATH, logs)
|
| 382 |
+
# yield "\n".join(logs), None, ""
|
| 383 |
+
# return
|
| 384 |
|
| 385 |
# Save logos into run-local dir
|
| 386 |
for item in LOGO_DIR.iterdir():
|
pipeline.py
CHANGED
|
@@ -326,8 +326,8 @@ if __name__ == '__main__':
|
|
| 326 |
|
| 327 |
logo_dir = Path(args.logo_dir)
|
| 328 |
logo_files = _list_logo_files(logo_dir)
|
| 329 |
-
if len(logo_files) == 0:
|
| 330 |
-
|
| 331 |
|
| 332 |
template_dir = ROOT_DIR / "template"
|
| 333 |
if template_dir.exists():
|
|
@@ -352,7 +352,7 @@ if __name__ == '__main__':
|
|
| 352 |
im = Image.open(logo_files[0]).convert("RGBA")
|
| 353 |
im.save(left_logo_path, format="PNG")
|
| 354 |
print(f"🖼️ Single logo saved → {left_logo_path.relative_to(ROOT_DIR)}")
|
| 355 |
-
|
| 356 |
# 多图:拼接
|
| 357 |
_compose_logos_horizontally(logo_files, left_logo_path, box_w=2000, box_h=476, gap=16)
|
| 358 |
|
|
|
|
| 326 |
|
| 327 |
logo_dir = Path(args.logo_dir)
|
| 328 |
logo_files = _list_logo_files(logo_dir)
|
| 329 |
+
# if len(logo_files) == 0:
|
| 330 |
+
# raise RuntimeError("❌ No logo files found in --logo_dir (must upload at least one).")
|
| 331 |
|
| 332 |
template_dir = ROOT_DIR / "template"
|
| 333 |
if template_dir.exists():
|
|
|
|
| 352 |
im = Image.open(logo_files[0]).convert("RGBA")
|
| 353 |
im.save(left_logo_path, format="PNG")
|
| 354 |
print(f"🖼️ Single logo saved → {left_logo_path.relative_to(ROOT_DIR)}")
|
| 355 |
+
elif len(logo_files) > 1:
|
| 356 |
# 多图:拼接
|
| 357 |
_compose_logos_horizontally(logo_files, left_logo_path, box_w=2000, box_h=476, gap=16)
|
| 358 |
|