Skip to content

Commit e11e9d1

Browse files
committed
fix(wit): Redirect WIT plugin to LIT
The WIT is no longer actively maintained, so redirect users to install the newer [Learning Interoperability Tool (LIT)](https://pair-code.github.io/lit/) instead. Contributes to #6195
1 parent 8e852e5 commit e11e9d1

File tree

13 files changed

+271
-18
lines changed

13 files changed

+271
-18
lines changed

tensorboard/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ py_library(
320320
"//tensorboard/plugins/profile_redirect:profile_redirect_plugin",
321321
"//tensorboard/plugins/scalar:scalars_plugin",
322322
"//tensorboard/plugins/text:text_plugin",
323+
"//tensorboard/plugins/wit_redirect:wit_redirect_plugin",
323324
],
324325
)
325326

tensorboard/components/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tf_ts_library(
2121
"//tensorboard/plugins/profile_redirect/tf_profile_redirect_dashboard",
2222
"//tensorboard/plugins/scalar/tf_scalar_dashboard",
2323
"//tensorboard/plugins/text/tf_text_dashboard",
24+
"//tensorboard/plugins/wit_redirect/tf_wit_redirect_dashboard",
2425
],
2526
)
2627

tensorboard/components/polymer3_lib.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ import '../plugins/profile_redirect/tf_profile_redirect_dashboard/tf-profile-red
2626
import '../plugins/pr_curve/tf_pr_curve_dashboard/tf-pr-curve-dashboard';
2727
import '../plugins/scalar/tf_scalar_dashboard/tf-scalar-dashboard';
2828
import '../plugins/text/tf_text_dashboard/tf-text-dashboard';
29+
import '../plugins/wit_redirect/tf_wit_redirect_dashboard/tf-wit-redirect-dashboard';
2930
import './polymer3_interop_helper';

tensorboard/default.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from tensorboard.plugins.scalar import scalars_plugin
4545
from tensorboard.plugins.text import text_plugin
4646
from tensorboard.plugins.mesh import mesh_plugin
47+
from tensorboard.plugins.wit_redirect import wit_redirect_plugin
4748

4849

4950
logger = logging.getLogger(__name__)
@@ -67,6 +68,7 @@
6768
profile_redirect_plugin.ProfileRedirectPluginLoader,
6869
hparams_plugin.HParamsPlugin,
6970
mesh_plugin.MeshPlugin,
71+
wit_redirect_plugin.WITRedirectPluginLoader,
7072
]
7173

7274

tensorboard/pip_package/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ protobuf >= 3.19.6
3030
requests >= 2.21.0, < 3
3131
setuptools >= 41.0.0 # Note: provides pkg_resources as well as setuptools
3232
tensorboard-data-server >= 0.7.0, < 0.8.0
33-
tensorboard-plugin-wit >= 1.6.0
3433
werkzeug >= 1.0.1
3534
wheel >= 0.26
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# What-If Tool
22

3+
> **Warning**
4+
> The What-If Tool is no longer actively maintained. Please use the actively
5+
> maintained [Learning Interpretability Tool (LIT)](https://pair-code.github.io/lit/)
6+
> instead.
7+
38
The What-If Tool code and documentation has moved to https://github.com/pair-code/what-if-tool.
49

510
The What-If Tool TensorBoard plugin has been converted to a dynamic plugin, through the tensorboard-plugin-wit pip package.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Description:
2+
# Plugin with installation instructions for dynamic interpretability plugin
3+
4+
package(default_visibility = ["//tensorboard:internal"])
5+
6+
licenses(["notice"])
7+
8+
py_library(
9+
name = "wit_redirect_plugin",
10+
srcs = ["wit_redirect_plugin.py"],
11+
srcs_version = "PY3",
12+
deps = [
13+
"//tensorboard/plugins:base_plugin",
14+
],
15+
)
16+
17+
py_test(
18+
name = "wit_redirect_plugin_test",
19+
srcs = ["wit_redirect_plugin_test.py"],
20+
srcs_version = "PY3",
21+
deps = [
22+
":wit_redirect_plugin",
23+
"//tensorboard:test",
24+
"//tensorboard/plugins:base_plugin",
25+
],
26+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load("//tensorboard/defs:defs.bzl", "tf_ts_library")
2+
3+
package(default_visibility = ["//tensorboard:internal"])
4+
5+
licenses(["notice"])
6+
7+
tf_ts_library(
8+
name = "tf_wit_redirect_dashboard",
9+
srcs = ["tf-wit-redirect-dashboard.ts"],
10+
strict_checks = False,
11+
deps = [
12+
"//tensorboard/components/polymer:irons_and_papers",
13+
"//tensorboard/components/polymer:legacy_element_mixin",
14+
"@npm//@polymer/decorators",
15+
"@npm//@polymer/polymer",
16+
],
17+
)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
==============================================================================*/
15+
16+
import {customElement, property} from '@polymer/decorators';
17+
import {html, PolymerElement} from '@polymer/polymer';
18+
import '../../../components/polymer/irons_and_papers';
19+
import {LegacyElementMixin} from '../../../components/polymer/legacy_element_mixin';
20+
21+
/**
22+
* A frontend that directs users to install the Learning Interoperability Plugin
23+
* (LIT) instead of the What-If Tools, since the latter is no longer maintained.
24+
*/
25+
@customElement('tf-wit-redirect-dashboard')
26+
class TfWITRedirectDashboard extends LegacyElementMixin(PolymerElement) {
27+
static readonly template = html`
28+
<div class="message">
29+
<h3>The What-If Tool is no longer supported.</h3>
30+
<p>
31+
The <a href="https://pair-code.github.io/lit/">Learning Interpretability Tool (LIT)</a>
32+
is an actively maintained alternative. Please follow the instructions
33+
<a href="https://pair-code.github.io/lit/setup/">here</a> to install and
34+
use this tool.
35+
</p>
36+
<style>
37+
:host {
38+
display: flex;
39+
}
40+
41+
.message {
42+
margin: 80px auto 0 auto;
43+
max-width: 540px;
44+
}
45+
#commandTextarea {
46+
margin-top: 1ex;
47+
padding: 1ex 1em;
48+
resize: vertical;
49+
width: 100%;
50+
}
51+
#copyContainer {
52+
display: flex;
53+
}
54+
#copiedMessage {
55+
align-self: center;
56+
flex-grow: 1;
57+
font-style: italic;
58+
padding-right: 1em;
59+
text-align: right;
60+
}
61+
</style>
62+
`;
63+
}

0 commit comments

Comments
 (0)