docling-project/docling · error · ValueError

Model `{self.repo_id}` does not support the `translate` task

Error message

Model `{self.repo_id}` does not support the `translate` task. Set task='transcribe' or choose a multilingual model with translation capability (e.g., `large-v3`).

What it means

Model validator on InlineAsrWhisperS2TOptions: the repo_id is in _NO_TRANSLATE_S2T_REPOS (English-only repos plus 'large-v3-turbo') but task='translate'. Whisper's translate task (X→English) requires a multilingual model; English-only and turbo checkpoints lack the capability, so the combination is rejected before load.

Source

Thrown at docling/datamodel/pipeline_options_asr_model.py:441

        Field(description=("Hardware accelerators supported by WhisperS2T.")),
    ] = [
        AcceleratorDevice.CPU,
        AcceleratorDevice.CUDA,
    ]

    @model_validator(mode="after")
    def _validate_repo_capabilities(self) -> "InlineAsrWhisperS2TOptions":
        # Reject non-English language for English-only repos
        if self.repo_id in _ENGLISH_ONLY_S2T_REPOS and self.language != "en":
            raise ValueError(
                f"Model `{self.repo_id}` is English-only and does not support "
                f"language `{self.language}`. Set language='en' or choose a "
                f"multilingual model (e.g., `tiny`, `base`, `small`, `medium`, "
                f"`large-v3`)."
            )
        # Reject translate task for repos without translate capability
        if self.repo_id in _NO_TRANSLATE_S2T_REPOS and self.task == "translate":
            raise ValueError(
                f"Model `{self.repo_id}` does not support the `translate` task. "
                f"Set task='transcribe' or choose a multilingual model with "
                f"translation capability (e.g., `large-v3`)."
            )
        return self

View on GitHub (pinned to 61d76f1ff3)

Solutions

  1. Use task='transcribe' with the current model.
  2. Or switch to a model with translation capability such as large-v3.
  3. Remember large-v3-turbo is explicitly in the no-translate set even though it is multilingual.

Example fix

# before
InlineAsrWhisperS2TOptions(repo_id='large-v3-turbo', task='translate')  # ValueError

# after
InlineAsrWhisperS2TOptions(repo_id='large-v3', task='translate')  # or keep turbo with task='transcribe'
Defensive patterns

Strategy: validation

Validate before calling

NO_TRANSLATE = _NO_TRANSLATE_S2T_REPOS  # english-only repos + 'large-v3-turbo'

def task_ok_for_repo(repo_id: str, task: str) -> bool:
    return repo_id not in NO_TRANSLATE or task != 'translate'

Prevention

When it happens

Trigger: InlineAsrWhisperS2TOptions(repo_id='large-v3-turbo', task='translate') or any English-only repo with task='translate'. Note the asymmetry: 'large-v3-turbo' transcribes multilingually but still cannot translate.

Common situations: Copy-pasting options from a large-v3 config onto a turbo model for speed; default task='translate' in a pipeline template applied to a distilled English model.

Related errors


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