{"record":{"id":"c69f4c8664c98dba","repo":"docling-project/docling","slug":"model-self-repo-id-is-english-only-and-does-no","errorCode":null,"errorMessage":"Model `{self.repo_id}` is English-only and does not support language `{self.language}`. Set language='en' or choose a multilingual model (e.g., `tiny`, `base`, `small`, `medium`, `large-v3`).","messagePattern":"Model `(.+?)` is English-only and does not support language `(.+?)`\\. Set language='en' or choose a multilingual model \\(e\\.g\\., `tiny`, `base`, `small`, `medium`, `large-v3`\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"docling/datamodel/pipeline_options_asr_model.py","lineNumber":433,"sourceCode":"            description=(\n                \"Optional text prompt to condition the transcription style or \"\n                \"provide context. Useful for domain-specific vocabulary.\"\n            )\n        ),\n    ] = None\n    supported_devices: Annotated[\n        list[AcceleratorDevice],\n        Field(description=(\"Hardware accelerators supported by WhisperS2T.\")),\n    ] = [\n        AcceleratorDevice.CPU,\n        AcceleratorDevice.CUDA,\n    ]\n\n    @model_validator(mode=\"after\")\n    def _validate_repo_capabilities(self) -> \"InlineAsrWhisperS2TOptions\":\n        # Reject non-English language for English-only repos\n        if self.repo_id in _ENGLISH_ONLY_S2T_REPOS and self.language != \"en\":\n            raise ValueError(\n                f\"Model `{self.repo_id}` is English-only and does not support \"\n                f\"language `{self.language}`. Set language='en' or choose a \"\n                f\"multilingual model (e.g., `tiny`, `base`, `small`, `medium`, \"\n                f\"`large-v3`).\"\n            )\n        # Reject translate task for repos without translate capability\n        if self.repo_id in _NO_TRANSLATE_S2T_REPOS and self.task == \"translate\":\n            raise ValueError(\n                f\"Model `{self.repo_id}` does not support the `translate` task. \"\n                f\"Set task='transcribe' or choose a multilingual model with \"\n                f\"translation capability (e.g., `large-v3`).\"\n            )\n        return self\n","sourceCodeStart":415,"sourceCodeEnd":447,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/datamodel/pipeline_options_asr_model.py#L415-L447","documentation":"Model validator on InlineAsrWhisperS2TOptions: the configured repo_id is in _ENGLISH_ONLY_S2T_REPOS (English-only WhisperS2T checkpoints like the *.en and distil-en models) but language is set to anything other than 'en'. English-only checkpoints have no multilingual decoder, so decoding any other language is impossible and rejected at options construction time.","triggerScenarios":"Building InlineAsrWhisperS2TOptions with an English-only repo (e.g., a distil-large-v3-en style checkpoint) together with language='fr' or any non-'en' value; defaults or config files that set a global language for all ASR models and are then reused with an English-only model.","commonSituations":"Shared ASR config across a multilingual pipeline switched to a faster English-distilled model without resetting language; auto-detection language settings ('auto' or None-style values) that count as non-'en'.","solutions":["Set language='en' when using an English-only repo.","Or switch to a multilingual checkpoint (tiny, base, small, medium, large-v3) as the message suggests.","Centralize the language/model pairing in config so changing a model resets language to 'en'."],"exampleFix":"# before\nInlineAsrWhisperS2TOptions(repo_id='distil-whisper/distil-large-v3.en', language='de')  # ValueError\n\n# after\nInlineAsrWhisperS2TOptions(repo_id='distil-whisper/distil-large-v3.en', language='en')","handlingStrategy":"validation","validationCode":"ENGLISH_ONLY = _ENGLISH_ONLY_S2T_REPOS  # from docling.datamodel.pipeline_options_asr_model\n\ndef language_ok_for_repo(repo_id: str, language: str) -> bool:\n    return repo_id not in ENGLISH_ONLY or language == 'en'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin language='en' whenever selecting an English-only or distil-en checkpoint.","Centralize repo_id/language pairs in config so they cannot drift apart.","Prefer multilingual checkpoints when language is user-configurable."],"tags":["asr","whisper","validation","pydantic"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}