[feature] Watermarked generation and detection (Gumbel-max algorithm) (#54053)
Signed-off-by: Raphael Rialland <raphael.rialland@mistral.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
OpenAI Codex
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
8c34a37232
commit
ea40bb9e90
@@ -46,6 +46,27 @@ def test_optional_type():
|
||||
assert optional_type_func("42") == 42
|
||||
|
||||
|
||||
def test_watermark_config_cli():
|
||||
parser = EngineArgs.add_cli_args(FlexibleArgumentParser())
|
||||
args = parser.parse_args(
|
||||
[
|
||||
"--model",
|
||||
"dummy",
|
||||
"--watermark-config",
|
||||
'{"algorithm":"gumbel","key":42,"prf":"philox"}',
|
||||
]
|
||||
)
|
||||
|
||||
config = EngineArgs.from_cli_args(args).create_watermark_config()
|
||||
|
||||
assert config is not None
|
||||
assert config.algorithm == "gumbel"
|
||||
assert config.key == 42
|
||||
assert config.context_width == 4
|
||||
assert config.prf == "philox"
|
||||
assert not config.supports_speculative_decoding
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"options",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user