htr-vlm-annotator / paths.py
dhuser's picture
Initial HTR VLM Annotator app
58cd314
Raw
History Blame Contribute Delete
364 Bytes
from __future__ import annotations
from pathlib import Path
APP_DIR = Path(__file__).resolve().parent
DATA_DIR = APP_DIR / "data"
PROMPTS_DIR = DATA_DIR / "prompts"
STATIC_DIR = APP_DIR / "static"
def read_text(path: Path, default: str = "") -> str:
try:
return path.read_text(encoding="utf-8")
except FileNotFoundError:
return default