detector_benchmark.watermark.sir¶

Submodules¶

Classes¶

SIR

Top-level class for SIR algorithm.

Package Contents¶

class detector_benchmark.watermark.sir.SIR(algorithm_config: dict, gen_model, transformers_config: detector_benchmark.utils.configs.ModelConfig, *args, **kwargs)¶

Bases: detector_benchmark.watermark.base.BaseWatermark

Top-level class for SIR algorithm.

config¶
utils¶
logits_processor¶
generate_watermarked_text(prompt: str, *args, **kwargs)¶

Generate watermarked text.

generate(encoded_prompts: list, *args, **kwargs) str¶

Generate watermarked text. Takes a list of encoded prompts as input, like transformers model.generate.

detect_watermark(text: str, return_dict: bool = True, *args, **kwargs)¶

Detect watermark in the input text.