Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.61 KB

tp_bert.md

File metadata and controls

31 lines (21 loc) · 1.61 KB

TP BERT

Give it before the 1st of February 2021, 8am (Grenoble hour).

here

The exercises of this TP, the instructions and the code are entirely contained in the Notebook tp_bert.ipynb, which you will find in this directory. There are two methods to open and run it, the first of which is highly recommended because it saves you from installing software on your local machine. In addition, the execution of the code will be faster.

Method 1: Google Colab

  • Sign up for Google Colab (if you don't already have a Google account) .
  • Once you have obtained access to a Colab file, you can download a Notebook using file->Upload Notebook. Download the file tp_bert.ipynb.
  • To enable the use of GPUs for your notebook: Runtime->Change runtime type->Hardware Accelerator->GPU .

Method 2: conda environment

Install Miniconda3 (Anaconda3 should also work), then, go to this TP directory (avec cd home/username/mypath) and execute the following commands:

Note: pip install transformers[torch] instals the CPU version of Pytorch. If you have a GPU on your computer, first install PyTorch for GPU following instructions here.

conda create --name bertenv python
conda activate bertenv
pip install transformers[torch]
conda install -c conda-forge notebook
conda install scikit-learn
conda install -c conda-forge ipywidgets
pip install tensorboardX

Now, you can open tp_bert.ipynb, use jupyter notebook in work directory