Fix rendering issue in quicktour (#20708)

* Fix rendering issue in quicktour

* Separate in two blocks
This commit is contained in:
Sylvain Gugger
2022-12-09 13:51:35 -05:00
committed by GitHub
parent 74330083b5
commit 799cea64ac

View File

@@ -440,13 +440,16 @@ Depending on your task, you'll typically pass the following parameters to [`Trai
>>> dataset = load_dataset("rotten_tomatoes") # doctest: +IGNORE_RESULT
```
5. Create a function to tokenize the dataset, and apply it over the entire dataset with [`~datasets.Dataset.map`]:
5. Create a function to tokenize the dataset:
```py
>>> def tokenize_dataset(dataset):
... return tokenizer(dataset["text"])
```
Then apply it over the entire dataset with [`~datasets.Dataset.map`]:
```py
>>> dataset = dataset.map(tokenize_dataset, batched=True)
```