-
Setup local cache directory for tensorflow hub
mkdir "${HOME}/tf-hub-cache" cp ~/.bash_profile ~/.bash_profile.bkup echo 'export TFHUB_CACHE_DIR="${HOME}/tf-hub-cache"' >> ~/.bash_profile source "${HOME}/.bash_profile" echo $TFHUB_CACHE_DIR
-
Create a new conda environment (let's call it
bert) and install requirementsconda create -n bert python=3.7 source activate bert (bert) pip install -r requirements.txtNOTE: if
source activate bertdoes not work, tryconda activate bert -
Download a Bert Model, and copy vocab file. Feel free to replace BERT URL form list of available modules. You would also need to change the local vocab path accordingly.
python download_bert.py cp $TFHUB_CACHE_DIR/ecd2596ce849110246602e3d4d81e2d9719cb027/assets/vocab.txt .
-
Get tokenization.py from the official BERT repository
-
Start jupyter
jupyter notebook
vineetm/tfhub-bert
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|