Skip to main content

clipscope

Github Repo

usage

import PIL
from clipscope import ConfiguredViT, TopKSAE

device='cpu'
filename_in_hf_repo = "22_resid/1200013184.pt"
sae = TopKSAE.from_pretrained(checkpoint=filename_in_hf_repo, device=device)

locations = [(22, 'resid')]
transformer = ConfiguredViT(locations, device=device)

input = PIL.Image.new("RGB", (224, 224), (0, 0, 0)) # black image for testing

activations = transformer.all_activations(input)[locations[0]] # (1, 257, 1024)
assert activations.shape == (1, 257, 1024)

activations = activations[:, 0] # just the cls token
# alternatively flatten the activations
# activations = activations.flatten(1)

print('activations shape', activations.shape)

output = sae.forward_verbose(activations)

print('output keys', output.keys())

print('latent shape', output['latent'].shape) # (1, 65536)
print('reconstruction shape', output['reconstruction'].shape) # (1, 1024)

Metadata

Release files for clipscope 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipscope 0.1.8
File Size Uploaded Provenance Actions
clipscope-0.1.8.tar.gz 3.9 kB Without provenance Details for clipscope-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clipscope 0.1.8
File Interpreter ABI Platform Actions
clipscope-0.1.8-py3-none-any.whl Python 3 none any Details for clipscope-0.1.8-py3-none-any.whl

Total release size: 8.5 kB

Release files / clipscope-0.1.8.tar.gz

Download URL clipscope-0.1.8.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5dc81e469a07d3538b84254120372c5537c96a4c094f70a4672a243e51329475
BLAKE2b-256 checksum
How to use checksums
edc588d15c8926fc2f0440c91f7cd524e817aa0c18381b1c6d246d9e22f87744
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / clipscope-0.1.8-py3-none-any.whl

Download URL clipscope-0.1.8-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
380a9eb7bd18dc474b27325ae8df3e2ee8fefdda209399e424a8c4285913da4d
BLAKE2b-256 checksum
How to use checksums
0486e2f5dbed7be2bf39778c432fae0f84ba4224f6e203ca4702d284a0e7f6b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Security for clipscope 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page