Skip to content

baggiponte/mav

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot

PyPI Python Versions PyPI - Downloads GitHub Repo stars Build Status License

Introduction

MAV - Model Activations Visualiser

image

Getting started

METHOD 1: 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"

METHOD 2: 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.mav import MAV
    
    MAV("gpt2", "Hello")

METHOD 3: 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"

METHOD 4: Inside Jupyter notebook/Colab

Open In Colab


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

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

Tutorials

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

uv run examples/vis_train_loop.py

running MAV with custom panel selection and arrangement

uv run --with git+https://github.com/attentionmech/mav mav --model gpt2 --num-grid-rows 3 --selected-panels generated_text attention_entropy top_predictions --max-bar-length 20 --refresh-rate 0 --max-new-tokens 10000

Demos

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

About

OpenMAV

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%