{"record":{"id":"14978ed39a55aada","repo":"huggingface/transformers","slug":"unknown-exporter-type-got-name-supported-expo","errorCode":null,"errorMessage":"Unknown exporter type, got {name} - supported exporters are: {list(AUTO_EXPORT_CONFIG_MAPPING.keys())}","messagePattern":"Unknown exporter type, got (.+?) - supported exporters are: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/exporters/auto.py","lineNumber":62,"sourceCode":"    The Auto-HF export config class that takes care of automatically dispatching to the correct\n    export config given an export config stored in a dictionary.\n    \"\"\"\n\n    @classmethod\n    def from_dict(cls, export_config_dict: dict):\n        export_format = export_config_dict.get(\"export_format\")\n\n        if export_format is None:\n            raise ValueError(\"export_config_dict must contain key 'export_format' set to exporter name\")\n\n        # Allow passing an ExportFormat enum value or a plain string\n        if isinstance(export_format, ExportFormat):\n            name = export_format.value\n        else:\n            name = export_format\n\n        if name not in AUTO_EXPORT_CONFIG_MAPPING:\n            raise ValueError(\n                f\"Unknown exporter type, got {name} - supported exporters are: {list(AUTO_EXPORT_CONFIG_MAPPING.keys())}\"\n            )\n\n        target_cls = AUTO_EXPORT_CONFIG_MAPPING[name]\n        return target_cls.from_dict(export_config_dict)\n\n\nclass AutoHfExporter:\n    \"\"\"\n    The Auto-HF expoerter class that takes care of automatically instantiating to the correct\n    `HfExporter` given the `ExportConfig`.\n    \"\"\"\n\n    @classmethod\n    def from_config(cls, export_config: ExportConfigMixin | dict, **kwargs) -> HfExporter:\n        # Normalize to a dict so ``supports_export_format`` can act as the single gate.\n        export_config_dict = export_config.to_dict() if isinstance(export_config, ExportConfigMixin) else export_config\n        if not cls.supports_export_format(export_config_dict):","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/exporters/auto.py#L44-L80","documentation":"Raised by AutoExportConfig.from_dict when the 'export_format' key of the config dict (given as a plain string or an ExportFormat enum) does not match any name registered in AUTO_EXPORT_CONFIG_MAPPING ('executorch', 'dynamo', 'onnx'). The error message lists the supported names so you can immediately see the valid options. It exists to stop an unsupported backend name from silently producing a wrong exporter.","triggerScenarios":"Calling AutoExportConfig.from_dict({...}) with export_format set to a typo or unregistered backend, e.g. 'onnxruntime', 'tflite', 'trt', 'torchscript', or 'ONNX' (case-sensitive), or passing an ExportFormat enum whose .value is not a registered key.","commonSituations":"Migrating from the legacy transformers.onnx CLI names to the new exporters API; hand-writing an export_config.json for a checkpoint; typos and casing mismatches; expecting a backend that requires third-party registration via register_export_config().","solutions":["Use one of the registered names exactly as listed in the error: 'dynamo', 'onnx', or 'executorch' (lowercase).","If you passed an ExportFormat enum, check its .value matches a registered key (print it: the mapping keys are in the error message).","If you genuinely need a custom backend, register a config class first with @register_export_config(\"<name>\") on a subclass of ExportConfigMixin.","Validate the key before calling: from transformers.exporters.auto import AUTO_EXPORT_CONFIG_MAPPING; assert name in AUTO_EXPORT_CONFIG_MAPPING."],"exampleFix":"# before\nconfig = AutoExportConfig.from_dict({\"export_format\": \"ONNX\"})  # ValueError\n\n# after\nconfig = AutoExportConfig.from_dict({\"export_format\": \"onnx\"})","handlingStrategy":"type-guard","validationCode":"from transformers.exporters.auto import AUTO_EXPORT_CONFIG_MAPPING\n\nname = cfg_dict.get(\"export_format\")\nname = name.value if hasattr(name, \"value\") else name\nif name not in AUTO_EXPORT_CONFIG_MAPPING:\n    raise KeyError(f\"unsupported export_format {name!r}; pick from {sorted(AUTO_EXPORT_CONFIG_MAPPING)}\")","typeGuard":"def is_known_export_format(name) -> bool:\n    from transformers.exporters.auto import AUTO_EXPORT_CONFIG_MAPPING\n    return name in AUTO_EXPORT_CONFIG_MAPPING","tryCatchPattern":"try:\n    cfg = AutoExportConfig.from_dict(d)\nexcept ValueError as e:\n    if \"Unknown exporter type\" in str(e):\n        # read the supported list from the message, prompt user/backend choice\n        raise\n    raise","preventionTips":["Derive the format name from AUTO_EXPORT_CONFIG_MAPPING keys, never hardcode strings","Freeze export_config.json schema checks in CI: assert d['export_format'] in AUTO_EXPORT_CONFIG_MAPPING","Remember names are lowercase and case-sensitive"],"tags":["export","config","registry","validation"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}