From c264c944204f955245209019376190f0d9242516 Mon Sep 17 00:00:00 2001
From: Alan <41682961+alan-cooney@users.noreply.github.com>
Date: Tue, 24 Oct 2023 09:53:37 +0800
Subject: [PATCH] Revert "Add html mime type (#82)" (#84)
This reverts commit c93ecbb8a68fe2172eb32d9578b31116c83d76f2.
---
python/Demonstration.ipynb | 4098 ++++++++---------
python/circuitsvis/utils/render.py | 26 +-
python/circuitsvis/utils/tests/test_render.py | 6 +-
3 files changed, 2056 insertions(+), 2074 deletions(-)
diff --git a/python/Demonstration.ipynb b/python/Demonstration.ipynb
index 5bf4cc3..52ac7c1 100644
--- a/python/Demonstration.ipynb
+++ b/python/Demonstration.ipynb
@@ -20,24 +20,31 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 1,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The autoreload extension is already loaded. To reload it, use:\n",
+ " %reload_ext autoreload\n"
+ ]
+ }
+ ],
"source": [
+ "# Enable python import reloading\n",
+ "%load_ext autoreload\n",
+ "%autoreload 2\n",
+ "\n",
"# Imports\n",
"import numpy as np\n",
"from circuitsvis.attention import attention_patterns, attention_pattern\n",
"from circuitsvis.activations import text_neuron_activations\n",
+ "from circuitsvis.examples import hello\n",
"from circuitsvis.tokens import colored_tokens\n",
"from circuitsvis.topk_tokens import topk_tokens\n",
- "from circuitsvis.topk_samples import topk_samples\n",
- "\n",
- "# Hot reload (for development only)\n",
- "from IPython import get_ipython\n",
- "ip = get_ipython()\n",
- "if not ip.extension_manager.loaded:\n",
- " ip.extension_manager.load('autoreload')\n",
- " %autoreload 2"
+ "from circuitsvis.topk_samples import topk_samples"
]
},
{
@@ -66,62 +73,62 @@
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "
\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 12,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 2,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -4978,62 +4981,62 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 13,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 3,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -9899,62 +9898,62 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 14,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 4,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -14807,62 +14802,62 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 15,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 5,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -19722,62 +19713,62 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 16,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 6,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -24631,62 +24618,62 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
" "
],
"text/plain": [
- ""
+ ""
]
},
- "execution_count": 17,
- "metadata": {
- "text/html": {
- "Content-Type": "text/html"
- }
- },
+ "execution_count": 7,
+ "metadata": {},
"output_type": "execute_result"
}
],
@@ -29549,62 +29532,62 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "\n",
+ "\n",
"