Tips on how to create an AI that chats such as you on WhatsApp

To train a GPT-2 neural network, first of all we need to pre-process the data, in order to obtain a single .txt with a machine-learning compatible structure.

2.1 Google Colab

For the sake of simplicity and since the machine learning model we will use requires a GPU to work, we’re going to use Google Colab for the next step.

If you don’t know what Google Colab is, check this other article here.

2.2 Start the notebook

Open this Colab notebook and follow these steps:

  1. Run the first block of cells called under the “0️⃣ Init” chapter
  2. Press “Run Anyway” on the pop-up
  3. Make sure that the first command !nvidia-smi shows that a GPU is connected (p100 is suggested)
  4. If no GPU is connected, go to Runtime > Change Runtime type > Hardware accelerator > GPU
Image for post