640 Google Colab Setup
0%

Run the Lab Notebook in Google Colab

The task: download lab_01.ipynb from the course portal, upload it to Google Colab, and run it there.

about 10 minutesfreeneeds a Google account
Steps
  1. •Before you start
  2. 11 — Download the notebook
  3. 22 — Open Colab and upload
  4. 33 — Pick a runtime and run
  5. 44 — Save and submit
  6. •Links
•

Before you start

  • A Google account.
  • The course portal password.
  • Chrome or Firefox.

Nothing to install. Colab runs the notebook on Google's machines, in the browser.

1

1 — Download the notebook

  • On the course portal, click lab_01.ipynb — or right-click it and choose Save link as.
  • Sign in with the course password if the browser asks.
  • Keep the .ipynb extension. If your browser saves it as lab_01.ipynb.txt, rename it back.
The portal is password protected, which is why Colab's Open notebook → from URL cannot fetch it. Download first, upload second.
2

2 — Open Colab and upload

It opens straight into an editable notebook. Colab saves it to your Drive under Colab Notebooks/, so it is there next time.

3

3 — Pick a runtime and run

  • Runtime → Change runtime type. CPU is enough for most of this lab; switch to T4 GPU for the PyTorch and Hugging Face cells at the end.
  • Runtime → Run all, or Shift+Enter cell by cell.

The first cell you run also starts the machine, which takes about 15 seconds. After that, cells run immediately.

If a library is missing, install it in a cell:

python
!pip install -q transformers
4

4 — Save and submit

  • The notebook autosaves to Drive as you work.
  • For the copy you hand in: File → Download → Download .ipynb, with the cell outputs visible.
The runtime disconnects after about 90 minutes idle, and 12 hours at most. Everything installed on it and every file written to /content is then gone — the notebook is the deliverable, not the machine.