Skip to main content

New version of Taker (Transformer Activation taKER)

Project description

Transformer Activation taKER.

Minimal implementation of TransformerLens syntax with limited feature set, but allows using hooked HuggingFace models.

New model architectures must manually be mapped in ./component_maps/ but an LLM should be able to assist you if you don't already have access to it.

Additionally, some activations cannot be modified (eg: attention scores) because these do not have natural hook points in HuggingFace transformers. The current minimal implementation may have slightly unpredictable edits (eg: resid_mid only modifies inputs to mlp, the edits do not propagate.)

Example syntax:

from neo_taker import Model
m = Model(model_repo="nickypro/tinyllama-15m", model_device="cuda:0", dtype="bf16")
tokens = m.to_tokens("Hello world!")

print( m.list_activation_points() )

hook_fn_print_name = lambda act, hook: print(hook.name, act.shape)
with m.hooks(["blocks.0.hook_resid_post", hook_fn_print_name]):
    logits = m(tokens, return_type="logits")

See development repo here: github.com/nickypro/neo-taker

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

neo_taker-0.1.1.tar.gz (243.8 kB view details)

Uploaded Source

Built Distribution

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

neo_taker-0.1.1-py3-none-any.whl (291.8 kB view details)

Uploaded Python 3

File details

Details for the file neo_taker-0.1.1.tar.gz.

File metadata

  • Download URL: neo_taker-0.1.1.tar.gz
  • Upload date:
  • Size: 243.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for neo_taker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9456cdeba3c0574280a9a7804cabdcfdad9f8154f5e847e3bf50ed91ac1f2fd4
MD5 54cd026c306d1b7116f0d9c548b6815b
BLAKE2b-256 0c130b9155904d1370aaef30f2a6926ddc64fb0480bf6d790969f4942a03f3f2

See more details on using hashes here.

File details

Details for the file neo_taker-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: neo_taker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 291.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for neo_taker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f2d9b0abdd8488963497208dddde052aced5b1d671c0cf24cd49740d4d969af
MD5 b90f5e4a1e640f31054c178eaa3ae6f3
BLAKE2b-256 3f8753438f0e549d1b82aad2d22e9fe0e44155cab672ab70bfd0a7f326818c87

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