Spaces:
Paused
Paused
UX Optimizations
#3
by ndebuhr - opened
122345---title: Synthid Texttitle: SynthID Textemoji: 🏃colorFrom: pinkcolorTo: gray22 unmodified lines23242526272627282930113 unmodified lines14414514614714714814914915015115215315315415515658 unmodified lines21521621721821821922022122122222322419 unmodified lines2442452462472472482492502 unmodified lines25325425525625625725825917 unmodified lines27727827928028028128228370 unmodified lines35435535635735835936036142 unmodified lines40440540640540740840941022 unmodified lines
_PROMPTS: Tuple[str] = ( 'Write an essay about my pets, a cat named Mika and a dog named Cleo.', 'Tell me everything you can about Portugal.', 'What is Hugging Face?', '', '',)
_TORCH_DEVICE = (113 unmodified lines
1. How to use SynthID Text to apply a watermark to text generated by your model; and 1. How to indetify that text using a ready-made detector. 1. How to identify that text using a ready-made detector.
Note that this detector is trained specifically fore this demonstration. You Note that this detector is trained specifically for this demonstration. You should maintain a specific watermarking configuration for every model you use and protect that configuration as you would any other secret. See the [end-to-end guide][synthid-hf-detector-e2e] for more on training your own detectors, and the [SynthID Text documentaiton][raitk-synthid] for more on detectors, and the [SynthID Text documentation][raitk-synthid] for more on how this technology works.
## Applying a watermark58 unmodified lines Lets use [Gemma 2B IT][gemma] to help you understand how watermarking works.
Using the text boxes below enter up to three prompts then click the generate button. Some examples are provided to help get you started, but they are button. An example is provided to help get you started, but the cells are fully editable.
Gemma will then generate watermarked and non-watermarked repsonses for each Gemma will then generate watermarked and non-watermarked responses for each non-empty prompt you provided.
[cloud-parameter-values]: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/prompts/adjust-parameter-values19 unmodified lines ## Human recognition of watermarked text
The primary goal of SynthID Text is to apply a watermark to generated text wihtout affecting generation quality. Another way to think about this is without affecting generation quality. Another way to think about this is that generated text that carries a watermark should be imperceptible to you, the reader, but easily perceived by a watermark detector.
2 unmodified lines see the true values.
The [research paper][synthid-nature] has an in-depth study examining human perception of watermared versus non-watermarked text. perception of watermarked versus non-watermarked text.
[synthid-nature]: https://www.nature.com/articles/s41586-024-08025-4 '''17 unmodified lines [end-to-end example][synthid-hf-detector-e2e] of how to train one of these detectors.
You can see how your guesses compared to the actaul results below. As You can see how your guesses compared to the actual results below. As above, the responses are displayed in checkboxes. If the box is checked, then the text carries a watermark. Your correct guesses are annotated with the "Correct" prefix.70 unmodified lines }
generate_btn.click( lambda: gr.update(value='Generating...', interactive=False), None, generate_btn ).then( generate, inputs=prompt_inputs, outputs=[generate_btn, generations_col, generations_grp, reveal_btn]42 unmodified lines detections_col: gr.Column(visible=False), revealed_grp: gr.CheckboxGroup(visible=False), reset_btn: gr.Button(visible=False), generate_btn: gr.Button(visible=True), generate_btn: gr.Button(value='Generate', interactive=True, visible=True), }
reset_btn.click(README.md+1-1
app.py+13-11