How to export widget to HTML

119 views
Skip to first unread message

Ignacio Amaya

unread,
Nov 8, 2019, 2:32:26 AM11/8/19
to What-If Tool
I am trying to create a standalone webapp from the created Widget from the tool (like in the web demos showed in https://pair-code.github.io/what-if-tool/index.html#demos). However, I am struggling to get it done. I have tried using Voila or  jupyter nbconvert but both have not worked. Also saving the widget state sometimes crashes and it does not allow the callbacks to run inferences if the person looking at the notebook does not run it (ideally I would like to have an HTML page so non-tech people could look at the results of the Widget).

James Wexler

unread,
Nov 8, 2019, 9:09:55 AM11/8/19
to What-If Tool
In order to run the What-If Tool in a webpage like the demos do, you would need to build that webapp separately instead of trying to convert from the notebook.

The code for those web demos lives in the directory https://github.com/tensorflow/tensorboard/tree/master/tensorboard/plugins/interactive_inference/tf_interactive_inference_dashboard/demo and can be built into static html pages with commands like "bazel run tensorboard/plugins/interactive_inference/tf_interactive_inference_dashboard/demo:imagedemoserver" as seen in the readme.

Those demos use models that run in the browser directly using TensorFlow.js. If instead you want to build a webapp with the What-If Tool that queries a model running in python, you would need to write javascript code to query that model from your webserver (or something similar) and provide the results back to the tool, in the same manner as the demo code does with the results from the TensorFlow.js models.
Reply all
Reply to author
Forward
0 new messages