From 799cea64ac1029d66e9e58f18bc6f47892270723 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Fri, 9 Dec 2022 13:51:35 -0500 Subject: [PATCH] Fix rendering issue in quicktour (#20708) * Fix rendering issue in quicktour * Separate in two blocks --- docs/source/en/quicktour.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/en/quicktour.mdx b/docs/source/en/quicktour.mdx index c0fcaa55cb..cf41ebb8d8 100644 --- a/docs/source/en/quicktour.mdx +++ b/docs/source/en/quicktour.mdx @@ -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) ```