-
Notifications
You must be signed in to change notification settings - Fork 27.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Watermarking LogitsProcessor and WatermarkDetector (#29676)
* add watermarking processor * remove the other hashing (context width=1 always) * make style * Update src/transformers/generation/logits_process.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/logits_process.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/logits_process.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/configuration_utils.py Co-authored-by: Joao Gante <[email protected]> * update watermarking process * add detector * update tests to use detector * fix failing tests * rename `input_seq` * make style * doc for processor * minor fixes * docs * make quality * Update src/transformers/generation/configuration_utils.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/logits_process.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/watermarking.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/watermarking.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/watermarking.py Co-authored-by: Joao Gante <[email protected]> * add PR suggestions * let's use lru_cache's default max size (128) * import processor if torch available * maybe like this * lets move the config to torch independet file * add docs * tiny docs fix to make the test happy * Update src/transformers/generation/configuration_utils.py Co-authored-by: Joao Gante <[email protected]> * Update src/transformers/generation/watermarking.py Co-authored-by: Joao Gante <[email protected]> * PR suggestions * add docs * fix test * fix docs * address pr comments * style * Revert "style" This reverts commit 7f33cc3. * correct style * make doctest green --------- Co-authored-by: Joao Gante <[email protected]>
- Loading branch information
1 parent
65ea190
commit 5ad960f
Showing
12 changed files
with
738 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.