waterfall 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -273,6 +273,9 @@ class Watermarker:
273
273
  else:
274
274
  ids = id
275
275
 
276
+ if k_p is None:
277
+ k_p = self.k_p
278
+
276
279
  if isinstance(k_p, int):
277
280
  k_ps = [k_p]
278
281
  else:
waterfall/watermark.py CHANGED
@@ -3,6 +3,7 @@ import logging
3
3
  import os
4
4
  import gc
5
5
  import torch
6
+ import numpy as np
6
7
  from typing import List, Literal, Optional, Tuple
7
8
 
8
9
  from transformers import AutoTokenizer, AutoModelForCausalLM
@@ -83,7 +84,7 @@ def verify_texts(texts: List[str], id: int,
83
84
  k_p: Optional[int] = None,
84
85
  model_path: Optional[str] = "meta-llama/Llama-3.1-8B-Instruct",
85
86
  return_extracted_k_p: bool = False
86
- ) -> Tuple[float,float]:
87
+ ) -> np.ndarray | Tuple[np.ndarray,np.ndarray]:
87
88
  """Returns the q_score and extracted k_p"""
88
89
 
89
90
  if watermarker is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: waterfall
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Scalable Framework for Robust Text Watermarking and Provenance for LLMs
5
5
  Project-URL: Homepage, https://github.com/aoi3142/Waterfall
6
6
  Project-URL: Issues, https://github.com/aoi3142/Waterfall/issues
@@ -1,12 +1,12 @@
1
- waterfall/WatermarkerBase.py,sha256=AyScrZz3hdjikvz5Fm4-B4acDz46i5wDFwCBg6Fp-vY,12947
1
+ waterfall/WatermarkerBase.py,sha256=NrDo4yJ4gnliTHH3LZemALpU_L-MCaPapevV1YnRHuE,12999
2
2
  waterfall/WatermarkingFn.py,sha256=-b-kGRdL0a7eKRqJmcHPAR_rCjxQYnsg1Ne6bTwBc1I,1931
3
3
  waterfall/WatermarkingFnFourier.py,sha256=QYayAQYwi1dQkDIyqmvhU568VhrVYTVy47HkI8F8SZs,1358
4
4
  waterfall/WatermarkingFnSquare.py,sha256=2PAO05DdKT02npo7GDf_82D520nP7kGAWK6H4E4JMt4,1638
5
5
  waterfall/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  waterfall/permute.py,sha256=RwxOHFhx_VSOhhFwy5s79YgwTUBkfW2-LCCXYR3VT2o,2582
7
- waterfall/watermark.py,sha256=d93C_DjnO2flLHZkRAC_L749CcUjIIGT9yPR91KkjOk,13452
8
- waterfall-0.1.5.dist-info/METADATA,sha256=aCbjPA6TZwVNcgrX9m0YDsaLcamx7-dayxKkjJmGUcA,8714
9
- waterfall-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- waterfall-0.1.5.dist-info/entry_points.txt,sha256=XXnUzuWXu2nc9j4WAll9tq6HyodN_8WJLjeG0O4Y2Gw,60
11
- waterfall-0.1.5.dist-info/licenses/LICENSE,sha256=zAtaO-k41Q-Q4Etl4bzuh7pgNJsPH-dYfzvznRa0OvM,11341
12
- waterfall-0.1.5.dist-info/RECORD,,
7
+ waterfall/watermark.py,sha256=W5jYGqYGOXXO-KLPKzJoin5zC_Xb6Xk9BzsAA9-LKXA,13494
8
+ waterfall-0.1.7.dist-info/METADATA,sha256=-QVkPeyZWXdPHr_SvhvIFyCNy3G2GuzHKPmg9w8Z1-I,8714
9
+ waterfall-0.1.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ waterfall-0.1.7.dist-info/entry_points.txt,sha256=XXnUzuWXu2nc9j4WAll9tq6HyodN_8WJLjeG0O4Y2Gw,60
11
+ waterfall-0.1.7.dist-info/licenses/LICENSE,sha256=zAtaO-k41Q-Q4Etl4bzuh7pgNJsPH-dYfzvznRa0OvM,11341
12
+ waterfall-0.1.7.dist-info/RECORD,,