Jupyter Notebook example for Question Answering with BERT for TensorFlow
Deploy the notebook
Prerequisites
- Nvidia Driver
- Docker CE
- Nvidia-Docker
- BERT Demo Jupyter Notebook (BERT_Demo.ipynb) - downloaded from this page.
Setup
Start The environment
Given that Docker and Nvidia-Docker are setup correctly on the demo server, launching this demo notebook should be as simple as running this command:
docker run --runtime=nvidia -it --net=host -v $(pwd):/workspace \
--name NGC-BERT-Demo-Notebook \
nvcr.io/nvidia/tensorflow:19.07-py3 \
jupyter notebook --ip=0.0.0.0 --allow-root --NotebookApp.token=''
This will start the Jupyter Notebook at http://: where is the IP of the server running this docker command, and will default to 8888. You should expect to see a page like below:
note - while this command will pull the 19-07-py3 version of the TensorFlow container - it may work with later versions, but the notebook is untested.
Execute the notebook
- This will start the Jupyter Notebook at
http://<IP>:<PORT>where<IP>is the IP of the server running this docker command, and<PORT>will default to 8888. - Now you can just click on the
BERT_Demo.ipynbto open the Notebook, and just start running through the cells using either the “Run” button at the top, or by pressing<Shift>+<Enter>when a given cell is highlighted.
Authentication
You can require a password in order to login to the demo notebook by replacing --NotebookApp.token='' with --NotebookApp.token='<password>' you'll then see a password screen when you navigate to the Notebook page in your browser.