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.2.tar.gz (244.2 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.2-py3-none-any.whl (294.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for neo_taker-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2dac29ae0189b47914afbb5213da86eb0b2d388967e99695d0cf9e125887c663
MD5 69c33086dab0b4c5e64fecfda6077c96
BLAKE2b-256 cf9a854472ec05e2052aaee9514dcbdb56ce25d499e65821aa6e23bbca802d23

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for neo_taker-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e7fbead3037ae29ae0498e12b6f6744ebfd23544a3f43f3500f8145a0b77d5b
MD5 03601e52ae3eabf59ed68485d99e967e
BLAKE2b-256 a6d72d40a77e9423b393b86b133628b0012747d9831285c6200cf17e44da97e7

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