Upload README.md with huggingface_hub
Browse files12345678910111213141516171819202122232425262728293031323334353637383940---tags: - sparse-autoencoder - diffusion - concept-erasurebase_model: - black-forest-labs/FLUX.1-dev - CompVis/stable-diffusion-v1-4---
# Sparse autoencoders of RING
The sparse autoencoders (SAEs) used in *One RING to Unlearn Them All: Concept Erasure from the Consensus ofUnlearned Models*. Code: [github.com/genwro-ai/ring](https://github.com/genwro-ai/ring).
One TopK SAE per block, with k = 256 and 32 times as many features as the block has channels, trained onactivations of the base model for 500 concept prompts and 4,500 COCO captions.
| directory | base model | block | features ||---|---|---|---|| `flux/transformer_blocks.18` | FLUX.1-dev | `transformer_blocks.18` | 98,304 || `flux/single_transformer_blocks.10` | FLUX.1-dev | `single_transformer_blocks.10` | 98,304 || `flux/single_transformer_blocks.20` | FLUX.1-dev | `single_transformer_blocks.20` | 98,304 || `sd14/down_blocks.2.attentions.1` | SD v1.4 | `down_blocks.2.attentions.1` | 40,960 || `sd14/mid_block.attentions.0` | SD v1.4 | `mid_block.attentions.0` | 40,960 || `sd14/up_blocks.1.attentions.1` | SD v1.4 | `up_blocks.1.attentions.1` | 40,960 |
Each directory holds `sae.safetensors` and `cfg.json`. FLUX.1-dev: activations of the image stream at 8 of 28denoising steps, 512 px. SD v1.4: 8 of 50 DDIM steps.
```pythonfrom huggingface_hub import snapshot_downloadfrom ring.sae.sae import Sae
root = snapshot_download("grrrml/ring-sae")sae = Sae.load_from_disk(f"{root}/flux/transformer_blocks.18", device="cuda")```
The scripts of the code repository take these directories as `--sae <block>=<directory>` (FLUX.1-dev) and`--sae_ckpt <directory>` (SD v1.4). The feature sets that RING scales are in `features/` of the code repository.README.mdAdded+40