DLS C5W4 Running on Mac locally Ungraded Lab 3 Transformer Network Application: Question Answering

Hi experts,
I downloaded this upgraded lab files as usual by clicking on:
“Lab Files → Download all files”
link near top right corner and saved as Files.zip.

I unzipped Files.zip to a local folder and fired up jupyter-lab in the folder <…>/Files/tf/W4A3_UGL.
But running the very first notebook cell fails to find datasets module and manually searching
all the files to no avail too.

from datasets import load_from_disk

# Load a dataset and print the first example in the training set
babi_dataset = load_from_disk('data/')
print(babi_dataset['train'][0])
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 from datasets import load_from_disk
      3 # Load a dataset and print the first example in the training set
      4 babi_dataset = load_from_disk('data/')

ModuleNotFoundError: No module named 'datasets'

Is datasets module meant to be included? Can someone please help as I intend to go through all
the labs & assignments over again running then locally.

Thanks,
MCW

Hi @Mun_Chung_Wong,

If you confirm that it is not part of the downloadable files, then these are two general steps that you can look into:

  1. google “from datasets import load_from_disk”
  2. since this is about datasets, read the lab’s description about the data

Hopefully they will provide you with some leads to go further.

Cheers,
Raymond

Ah yes thanks for the pointer your spot on. It’s not part of the downloadable.

As I am using multiple versions of python and associated packages for historical reason and it got
really messy.

datasets appears to be dependency of some other packages installed for one specific older
python version but not for 3.11 for which I have just updated jupyter.

Cheers,
MCW