Expand description
Runtime-asset path resolution shared by every crate.
All optional runtime assets (ONNX models, OCR dictionaries, the chunker
tokenizer) live under one directory, .models/ — dot-prefixed like
.pdfium/, so the plain models name stays free for source code.
Resolution is CWD-relative with an executable-directory fallback.
Functions§
- resolve
- Resolve a default (CWD-relative) asset path. If it doesn’t exist relative
to the current directory, try next to the executable and one level above
it (following symlinks — the layout
scripts/install/install.shproduces:/usr/local/bin/docling-rs→/usr/local/docling.rs/bin/docling-rswith.models/and.pdfium/in/usr/local/docling.rs). Returnsrelunchanged when nothing exists anywhere, so callers’ error messages keep the familiar path. Explicit env overrides never reach this.