A React app that hosts TDB as well as pages with information about individual model components (MLP neurons, attention heads and autoencoder latents for both).
First, install the app:
npm install
Then run the frontend:
npm start
- To open a Neuron Viewer page, navigate to
http://localhost:1234
. - To open TDB, navigate to
http://localhost:1234/gpt2-small/tdb_alpha
. - To open TDB with autoencoders, navigate to
http://localhost:1234/gpt2-small_ae-resid-delta-mlp-v4_ae-resid-delta-attn-v4/tdb_alpha
(whereae-resid-delta-mlp-v4
andae-resid-delta-attn-v4
must match the autoencoder names that are used in the activation server).
To check whether the code is correctly formatted:
npm run check-code-format
To format the code:
npm run format-code
- src/client: Auto-generated code for interacting with the activation server (the neuron viewer's backend). Do not edit this code! Follow the instructions in the activation server README to regenerate this code if you make changes to the activation server. Use src/requests when calling the activation server.
- src/panes: UI elements that can be used as panes on a page: tokens+activations, similar neurons, etc.
- src/requests: Client libraries for making network requests to the activation server.
- src/TransformerDebugger: Code related to the Transformer Debugger.
- src: Other code.
If you decide to run your activation server on a different host or port than the default, you can
point neuron viewer at it by setting the NEURON_VIEWER_ACTIVATION_SERVER_URL
environment variable:
NEURON_VIEWER_ACTIVATION_SERVER_URL=https://some.url:port npm start
Be sure to run the following to validate any changes you make:
npm run check-type-warnings && npm run check-code-format && npm run build