Hello,
I applied the WM to LLama2 and used the availably trained detector named "joaogante/dummy_synthid_detector".
The output is return probability, not 1 (watermarked) or 0 (unwatermarked).
Could you help me with threshold and how to train the detector?
from transformers import (
AutoTokenizer, BayesianDetectorModel, SynthIDTextWatermarkLogitsProcessor, SynthIDTextWatermarkDetector
)
# Load the detector. See examples/research_projects/synthid_text for training a detector.
detector_model = BayesianDetectorModel.from_pretrained("joaogante/dummy_synthid_detector")
logits_processor = SynthIDTextWatermarkLogitsProcessor(
**detector_model.config.watermarking_config, device="cpu"
)
tokenizer = AutoTokenizer.from_pretrained(detector_model.config.model_name)
detector = SynthIDTextWatermarkDetector(detector_model, logits_processor, tokenizer)
# Test whether a certain string is watermarked
test_input = tokenizer(["This is a test input"], return_tensors="pt")
is_watermarked = detector(test_input.input_ids)