Skip to content

Commit

Permalink
fixed issue with keys parameter in SynthID
Browse files Browse the repository at this point in the history
  • Loading branch information
marluxiaboss committed Nov 7, 2024
1 parent d4ba6c3 commit 7bf7166
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions detector_benchmark/watermark/synth_id/synth_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,15 @@ def __init__(
) -> None:
self.config = SynthIDConfig(algorithm_config, gen_model, transformers_config)
self.utils = SynthIDUtils(self.config)

# fix issue with the keys parameter of the config
keys_str = self.config["keys"]
keys = keys_str.replace("[", "").replace("]", "").split(",")
keys = [int(key) for key in keys]
self.config["keys"] = keys

self.logits_processor = SynthIDLogitsProcessor(self.config, self.utils)

self.detector = get_detector(self.config.detector_name, self.logits_processor)

def generate_watermarked_text(self, prompt: str, *args, **kwargs) -> str:
Expand Down

0 comments on commit 7bf7166

Please sign in to comment.