Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
JadenFiotto-Kaufman committed Dec 30, 2023
2 parents cc35a21 + 624d02b commit 69689f0
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 48 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added docs/.DS_Store
Binary file not shown.
Binary file added docs/source/.DS_Store
Binary file not shown.
Binary file added docs/source/_static/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ html[data-theme="light"] {

}

.ndif {
color: "green";
}

.bd-sidebar-primary {
width: fit-content !important;
padding-right: 40px !important
Expand All @@ -48,6 +52,15 @@ img {
pointer-events: none;
}

.img-bottom-sizing {
max-height: 10vh;
width: auto
}

.body-sizing{
height: 10vh;
}

.title-bot {
margin-bottom: -10px !important;
line-height: normal !important;
Expand Down
Binary file added docs/source/_static/images/.DS_Store
Binary file not shown.
Binary file added docs/source/_static/images/attribute_lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/images/ioi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 24 additions & 18 deletions docs/source/_templates/ndif_status.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
<style>
.ndif_status {
height: 18px;
width: 18px;
background-color: red;
border-radius: 50%;
display: inline-block;
margin-left: 5px;
vertical-align: middle;
}
</style>

<span><span>NDIF Status: </span><span class="ndif_status"></span></span>

<script>
let statusIcon = document.querySelector('.ndif .fa-circle-check');
fetch("{{ndif_url}}")
.then((response) => {
if (response.status == 200) {
Array.from(document.getElementsByClassName("ndif_status")).forEach((elm) => elm.style.backgroundColor = "green");
Array.from(document.getElementsByClassName("ndif")).forEach((ndifElement) => {
Array.from(ndifElement.getElementsByTagName('span')).forEach((spanElement) => {
spanElement.style.setProperty('color', '#23C552', 'important');
});
});
}
else {
Array.from(document.getElementsByClassName("ndif_status")).forEach((elm) => elm.style.backgroundColor = "red");
Array.from(document.getElementsByClassName("ndif")).forEach((ndifElement) => {
Array.from(ndifElement.getElementsByTagName('span')).forEach((spanElement) => {
spanElement.style.setProperty('color', '#F84F31', 'important');
});
});
if (statusIcon) {
statusIcon.classList.replace('fa-circle-check', 'fa-circle-xmark');
}
}
})
.catch((response) => {
Array.from(document.getElementsByClassName("ndif")).forEach((ndifElement) => {
Array.from(ndifElement.getElementsByTagName('span')).forEach((spanElement) => {
spanElement.style.setProperty('color', '#F84F31', 'important');
});
});
if (statusIcon) {
statusIcon.classList.replace('fa-circle-check', 'fa-circle-xmark');
}
})
.catch((response) => Array.from(document.getElementsByClassName("ndif_status")).forEach((elm) => elm.style.backgroundColor = "red"))

</script>
9 changes: 8 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
html_favicon = "_static/images/icon.ico"
html_show_sourcelink = False
html_theme_options = {
"logo": {"text": "nnsight"},
# "logo": {"text": "nnsight"},
"show_nav_level": 2,
"navbar_end": ["navbar-icon-links", "ndif_status"],
# "navbar_end": ["navbar-icon-links"],
"navbar_align": "left",
"icon_links": [
{
Expand All @@ -46,6 +47,12 @@
"url": "https://discord.gg/6uFJmCSwW7",
"icon": "fa-brands fa-discord",
},
{
"name": "Status",
"url": "https://discord.gg/6uFJmCSwW7",
"icon": "fa-solid fa-circle-check",
"attributes": {"class": "ndif"},
},
],
}

Expand Down
4 changes: 4 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ nnsight
tutorials
About <about>

.. toctree::
:hidden:
status

.. grid:: 1 1 2 2
:class-container: hero
:reverse:
Expand Down
25 changes: 0 additions & 25 deletions docs/source/notebooks/tutorials/dictionary_learning.ipynb

This file was deleted.

77 changes: 77 additions & 0 deletions docs/source/status.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
:html_theme.sidebar_secondary.remove:
:sd_hide_title:

status
======

.. toctree::
:maxdepth: 1
:hidden:



.. card::

All Systems Are Operational



.. div:: sd-fs-1 sd-font-weight-bold sd-text-center sd-text-primary sd-mb-5

Key Features

.. grid:: 1 1 2 2
:class-container: features

.. grid-item::

.. div:: features-container

.. image:: _static/images/one.png
:width: 250

.. div::

**Integration**

Pass in a ID from any HuggingFace Transformer repo and access its weights with nnsight.

.. grid-item::

.. div:: features-container

.. image:: _static/images/two.png
:width: 250

.. div::

**Interpretability**

Access the internal gradients and activations at any point or module in a model.

.. grid-item::

.. div:: features-container

.. image:: _static/images/two.png
:width: 250

.. div::

**Intuitive**

Set up a context block and manipulate model internals with only a couple lines of code.

.. grid-item::

.. div:: features-container

.. image:: _static/images/one.png
:width: 250

.. div::

**Interoperable**

Enable grad and train interventions like LORA or probes on any point in a model.

45 changes: 41 additions & 4 deletions docs/source/tutorials.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
Tutorials
============

.. grid:: 2
:gutter: 2

.. grid-item-card:: Walkthrough
:link: notebooks/walkthrough.ipynb

Main features of the nnsight library.

.. grid-item-card:: IOI Patching
:link: notebooks/tutorials/ioi_patching.ipynb

:bdg-primary:`arXiv:2211.00593`

.. grid-item-card:: Attribution Patching
:link: notebooks/tutorials/attribution_patching.ipynb

:bdg-primary:`arXiv:2308.09124`

.. grid-item-card:: Logit Lens
:link: notebooks/tutorials/logit_lens.ipynb

:bdg-primary:`nostalgebraist`

.. grid-item-card:: Future Lens
:link: notebooks/tutorials/future_lens.ipynb

:bdg-primary:`arXiv:2311.04897`

.. grid-item-card:: Function Vectors
:link: notebooks/tutorials/function_vectors.ipynb

:bdg-primary:`arXiv:2310.15213`

.. grid-item-card:: Dictionary Learning
:link: notebooks/tutorials/sae.ipynb

:bdg-primary:`arXiv:2309.08600`


.. toctree::
:maxdepth: 1
:hidden:

notebooks/tutorials/ioi_patching.ipynb
notebooks/tutorials/attribution_patching.ipynb
notebooks/tutorials/logit_lens.ipynb
notebooks/tutorials/future_lens.ipynb
notebooks/tutorials/function_vectors.ipynb
notebooks/tutorials/dictionary_learning.ipynb
notebooks/tutorials/sae.ipynb

.. toctree::
:hidden:

notebooks/tutorials/sae.ipynb

0 comments on commit 69689f0

Please sign in to comment.