Skip to main content

easy way to use llm watermarking techniques

Project description

this is the initial version for myself usage

example usage:

from llm_watermark import assembly_qwen3, huggingface_model


wm_model: huggingface_model = assembly_qwen3("8B")
prompt = "Write a short story about a robot learning to love."
messages = [{"role": "user", "content": prompt}]

wm_response = wm_model.generate(messages, do_watermark=True, max_new_tokens=256)
print("Watermarked Response:", wm_response)
print(wm_model.detect_watermark(wm_response))
print("----------------")

non_wm_response = wm_model.generate(messages, do_watermark=False, max_new_tokens=256)
print("Non-Watermarked Response:", non_wm_response)
print(wm_model.detect_watermark(non_wm_response))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_watermark-0.1.18.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_watermark-0.1.18-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_watermark-0.1.18.tar.gz.

File metadata

  • Download URL: llm_watermark-0.1.18.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for llm_watermark-0.1.18.tar.gz
Algorithm Hash digest
SHA256 3c4f9ed714f1e0bc7508e1f77002f913fd8062fcf05fb69b4b5ffd561c45ca9a
MD5 af8ba8cc05ea0255a9b8696c49ab9ee6
BLAKE2b-256 5e1bb442754948a22e4302843db1a97d9ea8c66ee5ffbc8d5c39e087f9da6b25

See more details on using hashes here.

File details

Details for the file llm_watermark-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: llm_watermark-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for llm_watermark-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 7cd83c876cdbb892a88002ed22f862c1750d89c8037e268f1b4f3397cc08045a
MD5 35e5cbd51b22151955a8205b568ec19e
BLAKE2b-256 faed1de610bd373367ad3c498e9083e1ee61ca99bd7fbb03860d09dea18a555d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page