{"record":{"id":"bc41c221f47dec10","repo":"huggingface/transformers","slug":"some-of-the-keys-in-watermarking-config-are-defi","errorCode":null,"errorMessage":"Some of the keys in `watermarking_config` are defined incorrectly. `{key}` should be {correct_value}` but found {found_value}","messagePattern":"Some of the keys in `watermarking_config` are defined incorrectly\\. `(.+?)` should be (.+?)` but found (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/transformers/generation/configuration_utils.py","lineNumber":1474,"sourceCode":"        greenlist_ratio: float = 0.25,\n        bias: float = 2.0,\n        hashing_key: int = 15485863,\n        seeding_scheme: str = \"lefthash\",\n        context_width: int = 1,\n    ):\n        self.greenlist_ratio = greenlist_ratio\n        self.bias = bias\n        self.hashing_key = hashing_key\n        self.seeding_scheme = seeding_scheme\n        self.context_width = context_width\n\n    def validate(self):\n        watermark_missing_arg_msg = (\n            \"Some of the keys in `watermarking_config` are defined incorrectly. `{key}` should be {correct_value}` \"\n            \"but found {found_value}\"\n        )\n        if self.seeding_scheme not in [\"selfhash\", \"lefthash\"]:\n            raise ValueError(\n                watermark_missing_arg_msg.format(\n                    key=\"seeding_scheme\",\n                    correct_value=\"[`selfhash`, `lefthash`]\",\n                    found_value=self.seeding_scheme,\n                ),\n            )\n        if not 0.0 <= self.greenlist_ratio <= 1.0:\n            raise ValueError(\n                watermark_missing_arg_msg.format(\n                    key=\"greenlist_ratio\",\n                    correct_value=\"in range between 0.0 and 1.0\",\n                    found_value=self.seeding_scheme,\n                ),\n            )\n        if not self.context_width >= 1:\n            raise ValueError(\n                watermark_missing_arg_msg.format(\n                    key=\"context_width\",","sourceCodeStart":1456,"sourceCodeEnd":1492,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/generation/configuration_utils.py#L1456-L1492","documentation":"ValueError from WatermarkingConfig.validate(): seeding_scheme must be one of 'selfhash' or 'lefthash' (the two supported hash-input schemes for the Kirchenbauer watermark logits processor). Any other string is rejected because the watermark detector would compute a different greenlist than the generator, silently breaking detectability.","triggerScenarios":"WatermarkingConfig(greenlist_ratio=0.25, seeding_scheme='self-hash') (hyphen instead of 'selfhash'); passing a SynthID-style or custom scheme name; typo like 'left_hash'. Note the message template has a stray backtick and interpolates the found value, so read key/correct_value carefully.","commonSituations":"Copying scheme names from papers or blog posts ('self-hash', 'ff-additive') rather than the supported set; version upgrades where accepted scheme strings changed.","solutions":["Use exactly 'selfhash' or 'lefthash' as seeding_scheme","Remove the argument entirely to keep the default scheme","Check the installed version's docstring for WatermarkingConfig to see supported values"],"exampleFix":"# before\nwm = WatermarkingConfig(greenlist_ratio=0.25, seeding_scheme='self-hash')\n# after\nwm = WatermarkingConfig(greenlist_ratio=0.25, seeding_scheme='selfhash')","handlingStrategy":"validation","validationCode":"if wm_cfg.seeding_scheme not in ('selfhash', 'lefthash'):\n    wm_cfg.seeding_scheme = 'selfhash'  # or raise","typeGuard":"def valid_scheme(s: str) -> bool:\n    return s in ('selfhash', 'lefthash')","tryCatchPattern":null,"preventionTips":["Use the literal strings 'selfhash'/'lefthash' — no hyphens","Let the default scheme apply unless you specifically need selfhash"],"tags":["watermarking","generation-config","validation"],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}