# How to decode with spaces?

**URL:** <https://discuss.huggingface.co/t/how-to-decode-with-spaces/17289>\
**Category:** 🤗Tokenizers\
**Created:** [April 28, 2022, 1:39pm UTC](https://discuss.huggingface.co/t/how-to-decode-with-spaces/17289 "2022-04-28T13:39:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timbmg](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/timbmg/32/42495_2.png) [@timbmg](https://discuss.huggingface.co/u/timbmg)\
**Post date:** [April 28, 2022, 1:39pm UTC](https://discuss.huggingface.co/t/how-to-decode-with-spaces/17289/1 "2022-04-28T13:39:45Z")

</div>

How can I decode token by token, i.e. without the tokenizer removing spaces for punctuation? In the example below, i would expect `[CLS] hello world . [SEP]`, i.e. a space between `world` and `.`.

```auto
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
x = tokenizer.encode("Hello World.")
tokenizer.decode(x, clean_up_tokenization_spaces=False)
# '[CLS] hello world. [SEP]'

```
