Skip to main content

Model Activation Visualizer

Project description

+===========================================================================+
|          _____                    _____                    _____          |
|         /\    \                  /\    \                  /\    \         |
|        /::\____\                /::\    \                /::\____\        |
|       /::::|   |               /::::\    \              /:::/    /        |
|      /:::::|   |              /::::::\    \            /:::/    /         |
|     /::::::|   |             /:::/\:::\    \          /:::/    /          |
|    /:::/|::|   |            /:::/__\:::\    \        /:::/____/           |
|   /:::/ |::|   |           /::::\   \:::\    \       |::|    |            |
|  /:::/  |::|___|______    /::::::\   \:::\    \      |::|    |     _____  |
| /:::/   |::::::::\    \  /:::/\:::\   \:::\    \     |::|    |    /\    \ |
|/:::/    |:::::::::\____\/:::/  \:::\   \:::\____\    |::|    |   /::\____\|
|\::/    / ~~~~~/:::/    /\::/    \:::\  /:::/    /    |::|    |  /:::/    /|
| \/____/      /:::/    /  \/____/ \:::\/:::/    /     |::|    | /:::/    / |
|             /:::/    /            \::::::/    /      |::|____|/:::/    /  |
|            /:::/    /              \::::/    /       |:::::::::::/    /   |
|           /:::/    /               /:::/    /        \::::::::::/____/    |
|          /:::/    /               /:::/    /          ~~~~~~~~~~          |
|         /:::/    /               /:::/    /                               |
|        /:::/    /               /:::/    /                                |
|        \::/    /                \::/    /                                 |
|         \/____/                  \/____/                                  |
+===========================================================================+
Screenshot

Model Activations Visualiser

Getting started

If uv is installed:

uv run --with openmav mav

or

uv run --with git+https://github.com/attentionmech/mav mav --model gpt2 --prompt "hello mello"

Without uv:

  1. Set up and activate a virtual environment

  2. Install the package:

    pip install openmav
    

    or

    pip install git+https://github.com/attentionmech/mav
    
  3. Run:

    mav --model gpt2 --prompt "hello mello"
    
  4. or Import

    from openmav import MAV
    
    MAV("gpt2", "Hello")
    

Locally from scratch

  1. git clone https://github.com/attentionmech/mav
  2. cd mav
  3. Set up and activate a virtual environment
  4. Install the package:
    pip install .
    
  5. Run:
    mav --model gpt2 --prompt "hello mello"
    

You can replace gpt2 with other Hugging Face models for example:

  • meta-llama/Llama-3.2-1B
  • HuggingFaceTB/SmolLM-135M
  • gpt2-medium
  • gpt2-large

Examples

running MAV with a training loop with a custom model (not pretrained one)

uv run examples/vis_train_loop.py

Demos

Note: explore it using the command line help as well, since many sampling params are exposed.

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

openmav-0.0.6.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

openmav-0.0.6-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file openmav-0.0.6.tar.gz.

File metadata

  • Download URL: openmav-0.0.6.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for openmav-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1ac94c891bb41021c0143bf246c0051e2b5259cb5ab1d7aa666ab2d7abf87e25
MD5 8b47bc201a8fbb761c78ac5d5d316996
BLAKE2b-256 aee4ba0e725c4da029a957a49688bbe843d34fd3e86d37cbbe9148722048453b

See more details on using hashes here.

File details

Details for the file openmav-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: openmav-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for openmav-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0ebd9d4b3ef3b428fa17ef4c7d9987c3421a7fb43492e570deba2382af800835
MD5 c1a7f60a0d4bda69367f23fad3b6a3f6
BLAKE2b-256 1278e57cee4fb53c39d397861313db477befd2a1a0e976ab8f33fd5dc14ad4e7

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