File tree 6 files changed +213
-105
lines changed
tensorflow_model_analysis
6 files changed +213
-105
lines changed Original file line number Diff line number Diff line change 54
54
* metrics_plots_and_validations_writer was failing while writing cross
55
55
slice comparison results to metrics file.
56
56
* Fairness widget view was not compatible with cross slicing key type.
57
+ * Fix support for exporting the UI from a notebook to a standalone HTML page.
57
58
* Depends on ` absl-py>=0.9,<0.13 ` .
58
59
* Depends on ` tensorflow-metadata>=0.29.0,<0.30.0 ` .
59
60
* Depends on ` tfx-bsl>=0.29.0,<0.30.0 ` .
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ module.exports = {
20
20
id : 'tensorflow_model_analysis' ,
21
21
requires : [ base . IJupyterWidgetRegistry ] ,
22
22
activate : function ( app , widgets ) {
23
+ // Set a global variable to mark plugin as being run within Jupyter Lab.
24
+ window [ 'isJupyterLab' ] = true ;
23
25
widgets . registerWidget ( {
24
26
name : 'tensorflow_model_analysis' ,
25
27
version : plugin . version ,
Original file line number Diff line number Diff line change @@ -21,9 +21,23 @@ const version = require('../package.json').version;
21
21
* Helper method to load the vulcanized templates.
22
22
*/
23
23
function loadVulcanizedTemplate ( ) {
24
- const templateLocation =
25
- ( document . querySelector ( 'body' ) . getAttribute ( 'data-base-url' ) || '/' ) +
26
- 'nbextensions/tensorflow_model_analysis/vulcanized_tfma.js' ;
24
+ let templatePath ;
25
+ const dataBaseUrl =
26
+ document . querySelector ( 'body' ) . getAttribute ( 'data-base-url' ) ;
27
+ // Jupyter Classic
28
+ if ( dataBaseUrl ) {
29
+ templatePath = dataBaseUrl + 'nbextensions/tensorflow_model_analysis/' ;
30
+ }
31
+ // Jupyter Lab
32
+ else if ( window [ 'isJupyterLab' ] ) {
33
+ templatePath = '/nbextensions/tensorflow_model_analysis/' ;
34
+ }
35
+ // Kubeflow
36
+ else {
37
+ templatePath = __webpack_public_path__ ;
38
+ }
39
+ // templatePath ends with a slash.
40
+ const templateLocation = `${ templatePath } vulcanized_tfma.js` ;
27
41
28
42
// If the vulcanizes tempalets are not loaded yet, load it now.
29
43
if ( ! document . querySelector ( 'script[src="' + templateLocation + '"]' ) ) {
Original file line number Diff line number Diff line change 1
- /**
2
- * Copyright 2018 Google LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
1
define ( function ( ) { return /******/ ( function ( modules ) { // webpackBootstrap
17
2
/******/ // The module cache
18
3
/******/ var installedModules = { } ;
@@ -105,7 +90,8 @@ if (window.require) {
105
90
window . require . config ( {
106
91
map : {
107
92
'*' : {
108
- 'tensorflow_model_analysis' : 'nbextensions/tensorflow_model_analysis/index' ,
93
+ 'tensorflow_model_analysis' :
94
+ 'nbextensions/tensorflow_model_analysis/index' ,
109
95
}
110
96
}
111
97
} ) ;
@@ -118,4 +104,4 @@ module.exports = {
118
104
119
105
120
106
/***/ } )
121
- /******/ ] ) } ) ; ;
107
+ /******/ ] ) } ) ; ;
You can’t perform that action at this time.
0 commit comments