huggingface/transformers · error · ValueError
Some of the keys in `watermarking_config` are defined incorr
Error message
Some of the keys in `watermarking_config` are defined incorrectly. `{key}` should be {correct_value}` but found {found_value} What it means
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.
Source
Thrown at src/transformers/generation/configuration_utils.py:1474
greenlist_ratio: float = 0.25,
bias: float = 2.0,
hashing_key: int = 15485863,
seeding_scheme: str = "lefthash",
context_width: int = 1,
):
self.greenlist_ratio = greenlist_ratio
self.bias = bias
self.hashing_key = hashing_key
self.seeding_scheme = seeding_scheme
self.context_width = context_width
def validate(self):
watermark_missing_arg_msg = (
"Some of the keys in `watermarking_config` are defined incorrectly. `{key}` should be {correct_value}` "
"but found {found_value}"
)
if self.seeding_scheme not in ["selfhash", "lefthash"]:
raise ValueError(
watermark_missing_arg_msg.format(
key="seeding_scheme",
correct_value="[`selfhash`, `lefthash`]",
found_value=self.seeding_scheme,
),
)
if not 0.0 <= self.greenlist_ratio <= 1.0:
raise ValueError(
watermark_missing_arg_msg.format(
key="greenlist_ratio",
correct_value="in range between 0.0 and 1.0",
found_value=self.seeding_scheme,
),
)
if not self.context_width >= 1:
raise ValueError(
watermark_missing_arg_msg.format(
key="context_width",View on GitHub (pinned to a597f97485)
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
Example fix
# before wm = WatermarkingConfig(greenlist_ratio=0.25, seeding_scheme='self-hash') # after wm = WatermarkingConfig(greenlist_ratio=0.25, seeding_scheme='selfhash')
Defensive patterns
Strategy: validation
Validate before calling
if wm_cfg.seeding_scheme not in ('selfhash', 'lefthash'):
wm_cfg.seeding_scheme = 'selfhash' # or raise Type guard
def valid_scheme(s: str) -> bool:
return s in ('selfhash', 'lefthash') Prevention
- Use the literal strings 'selfhash'/'lefthash' — no hyphens
- Let the default scheme apply unless you specifically need selfhash
When it happens
Trigger: 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.
Common situations: Copying scheme names from papers or blog posts ('self-hash', 'ff-additive') rather than the supported set; version upgrades where accepted scheme strings changed.
Related errors
- `early_stopping` must be a boolean or 'never', but is {}.
- `max_new_tokens` must be greater than 0, but is {}.
- Invalid `cache_implementation` ({}). Choose one of: {}
- Greedy methods (do_sample != True) without beam search do no
- `num_return_sequences` ({}) has to be smaller or equal to `n
AI-assisted analysis of huggingface/transformers@a597f97485 (2026-08-14).
Data as JSON: /api/errors/bc41c221f47dec10.
Report an issue: GitHub.