huggingface/transformers · error · ValueError
seeding_scheme has to be one of [`selfhash`, `lefthash`], bu
Error message
seeding_scheme has to be one of [`selfhash`, `lefthash`], but found {seeding_scheme} What it means
Error "seeding_scheme has to be one of [`selfhash`, `lefthash`], but found {seeding_scheme}" thrown in huggingface/transformers.
Source
Thrown at src/transformers/generation/logits_process.py:2462
>>> detector = WatermarkDetector(model_config=model.config, device="cpu", watermarking_config= watermarking_config)
>>> detection_preds = detector(out)
>>> detection_preds
array([ True])
```
"""
def __init__(
self,
vocab_size,
device,
greenlist_ratio: float = 0.25,
bias: float = 2.0,
hashing_key: int = 15485863,
seeding_scheme: str = "lefthash",
context_width: int = 1,
):
if seeding_scheme not in ["selfhash", "lefthash"]:
raise ValueError(f"seeding_scheme has to be one of [`selfhash`, `lefthash`], but found {seeding_scheme}")
if greenlist_ratio >= 1.0 or greenlist_ratio <= 0.0:
raise ValueError(
f"greenlist_ratio has be in range between 0.0 and 1.0, exclusively. but found {greenlist_ratio}"
)
self.vocab_size = vocab_size
self.greenlist_size = int(self.vocab_size * greenlist_ratio)
self.bias = bias
self.seeding_scheme = seeding_scheme
self.rng = torch.Generator(device=device)
self.hash_key = hashing_key
self.context_width = context_width
self.rng.manual_seed(hashing_key)
self.table_size = 1_000_003
self.fixed_table = torch.randperm(self.table_size, generator=self.rng, device=device)
def set_seed(self, input_seq: torch.LongTensor):View on GitHub (pinned to a597f97485)
Solutions
- Set `seeding_scheme` to 'selfhash' or 'lefthash' in the watermarking config.
- Use the default `WatermarkingConfig()` which already picks a valid scheme.
When it happens
Trigger: Raised in WatermarkLogitsProcessor.__init__ when seeding_scheme is neither 'selfhash' nor 'lefthash'.
Common situations: Typo or unsupported value in WatermarkingConfig.seeding_scheme when enabling text watermarking.
AI-assisted analysis of huggingface/transformers@a597f97485 (2026-08-14).
Data as JSON: /api/errors/fba97ac9cd766a30.
Report an issue: GitHub.