"Trainer - a PyTorch optimized training loop" example code

Hello.

I am getting an error in the “Trainer - a PyTorch optimized training loop” section of the " Quick tour" page (Quick tour) for the code that is given as an example.

“NameError: name ‘dataset’ is not defined”

Please list the missing lines of code that define the dataset listed in this “Trainer - a PyTorch optimized training loop” section.

I am assuming it would include a “dataset = load_dataset” line and a “from datasets import load_dataset” line.

But I am not sure how to write these lines out in full or what other lines the example might be missing to get the code working in full.

Hello, thanks for reporting this error! We’ve added code to include an actual dataset you can run the code samples with (see this pull request). You can view the changes in the main version of the docs. :slight_smile: