# Huggingface Dataset.map shows red progress bar when batched=True

**URL:** <https://discuss.huggingface.co/t/huggingface-dataset-map-shows-red-progress-bar-when-batched-true/24859>\
**Category:** 🤗Datasets\
**Created:** [October 24, 2022, 1:05am UTC](https://discuss.huggingface.co/t/huggingface-dataset-map-shows-red-progress-bar-when-batched-true/24859 "2022-10-24T01:05:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liujxing](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@liujxing](https://discuss.huggingface.co/u/liujxing)\
**Post date:** [October 24, 2022, 1:05am UTC](https://discuss.huggingface.co/t/huggingface-dataset-map-shows-red-progress-bar-when-batched-true/24859/1 "2022-10-24T01:05:48Z")

</div>

I have the following simple code copied from Huggingface examples:

```auto
model_checkpoint = "distilgpt2"

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint, use_fast=True)

def tokenize_function(examples):
    return tokenizer(examples["text"])

from datasets import load_dataset
datasets = load_dataset('wikitext', 'wikitext-2-raw-v1')
tokenized_datasets = datasets.map(tokenize_function, batched=False, num_proc=4, remove_columns=["text"])

```

When I set `batched=False` then the progress bar shows green color which indicates success, but if I set `batched=True` then the progress bar shows red color and does not reach 100%. Does that mean my `map` function failed or something else?

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [October 24, 2022, 3:51pm UTC](https://discuss.huggingface.co/t/huggingface-dataset-map-shows-red-progress-bar-when-batched-true/24859/2 "2022-10-24T15:51:50Z")

</div>

Hi! You can find the explanation and solution to this issue in this thread: [While tokenizing the dataset I'm getting this type of error](https://discuss.huggingface.co/t/while-tokenizing-the-dataset-im-getting-this-type-of-error/24779)
