docling-project/docling · error · FileNotFoundError

Nemotron OCR artifacts not found or incomplete in artifacts_

Error message

Nemotron OCR artifacts not found or incomplete in artifacts_path.
Expected location: {nemotron_lang_dir}
Required files: {self._nemotron_checkpoint_files}
Available directories in {artifacts_path}: {available_dirs}
Use `docling-tools models download nemotron_ocr` to pre-download the checkpoints or unset artifacts_path to allow the upstream package to download them.

What it means

When artifacts_path is set, the Nemotron stage requires the language-specific checkpoint directory to exist and to contain every file listed by the upstream CHECKPOINT_FILES constant. If the directory is missing or any required file is absent, FileNotFoundError is raised listing the expected location, required files, and the directories that do exist under artifacts_path.

Source

Thrown at docling/models/stages/ocr/nemotron_ocr_model.py:213

            return None

        nemotron_lang_dir = (
            artifacts_path
            / nemotron_ocr_model_dir()
            / _NEMOTRON_OCR_LANG_TO_ARTIFACT_PATHS[language]
        )
        if nemotron_lang_dir.is_dir() and all(
            (nemotron_lang_dir / f).is_file() for f in self._nemotron_checkpoint_files
        ):
            return nemotron_lang_dir

        available_dirs = []
        if artifacts_path.exists():
            available_dirs = sorted(
                path.name for path in artifacts_path.iterdir() if path.is_dir()
            )

        raise FileNotFoundError(
            "Nemotron OCR artifacts not found or incomplete in artifacts_path.\n"
            f"Expected location: {nemotron_lang_dir}\n"
            f"Required files: {self._nemotron_checkpoint_files}\n"
            f"Available directories in {artifacts_path}: {available_dirs}\n"
            "Use `docling-tools models download nemotron_ocr` to pre-download "
            "the checkpoints or unset artifacts_path to allow the upstream "
            "package to download them."
        )

    @staticmethod
    def download_models(
        local_dir: Optional[Path] = None,
        force: bool = False,
        progress: bool = False,
    ) -> Path:
        if local_dir is None:
            local_dir = settings.cache_dir / "models" / nemotron_ocr_model_dir()

View on GitHub (pinned to 61d76f1ff3)

Solutions

  1. Pre-download the checkpoints: `docling-tools models download nemotron_ocr` into your artifacts_path and retry.
  2. Or unset artifacts_path for this run so the upstream nemotron_ocr package downloads to its own cache automatically.
  3. Compare the 'Required files' list in the error against what is on disk; delete the partial directory and re-download if any file is missing.

Example fix

# before
pipeline_options.artifacts_path = Path("./models")  # lacks nemotron_ocr/en -> FileNotFoundError

# after (terminal)
docling-tools models download nemotron_ocr --artifacts-path ./models
# or
pipeline_options.artifacts_path = None  # let the package download its own checkpoints
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

def nemotron_artifacts_complete(artifacts: Path, lang_dir: str, required: list[str]) -> bool:
    d = artifacts / "nemotron_ocr" / lang_dir
    return d.is_dir() and all((d / f).is_file() for f in required)

Try / catch

try:
    converter = DocumentConverter(format_options={"pdf": PdfFormatOptions(ocr_options=NemotronOcrOptions())})
except FileNotFoundError as err:
    logger.error("Incomplete Nemotron artifacts: %s", err)
    raise SystemExit("Run: docling-tools models download nemotron_ocr") from err

Prevention

When it happens

Trigger: Setting pipeline_options.artifacts_path to a directory that lacks the nemotron_ocr/<lang> subdirectory (or has an incomplete download), then constructing the pipeline with NemotronOcrOptions.

Common situations: Reusing an artifacts_path populated for other docling models (layout, tableformer) but never Nemotron; interrupted `docling-tools models download nemotron_ocr`; wrong language variant downloaded.

Related errors


AI-assisted analysis of docling-project/docling@61d76f1ff3 (2026-08-14). Data as JSON: /api/errors/a86bfad4fc6bb5e4. Report an issue: GitHub.