# \`ValueError: 'p' is not in list\`

**URL:** <https://discuss.huggingface.co/t/valueerror-p-is-not-in-list/13820>\
**Category:** Beginners\
**Created:** [January 17, 2022, 8:01pm UTC](https://discuss.huggingface.co/t/valueerror-p-is-not-in-list/13820 "2022-01-17T20:01:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toyl](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@toyl](https://discuss.huggingface.co/u/toyl)\
**Post date:** [January 17, 2022, 8:01pm UTC](https://discuss.huggingface.co/t/valueerror-p-is-not-in-list/13820/1 "2022-01-17T20:01:41Z")

</div>

I followed the code that exists in this post by BramVanroy [Generate raw word embeddings using transformer models like BERT for downstream process - #2 by BramVanroy](https://discuss.huggingface.co/t/generate-raw-word-embeddings-using-transformer-models-like-bert-for-downstream-process/2958/2) to get the embeddings for each word but if have a file that contains more than 20.000 sentences and gets a lot of tokens that throw like this error  
`ValueError: 'p' is not in list`

from the list which return  
`sent.split() ['smoke', 'coming', 'out', 'of', 'stack', 'with', 'green', 'traffic', 'light', 'and', 'picture', 'of', 'mr', 'peanut', 'on', 'building']`

`p` here error from word `peanut`  
I am already can add new-token but manually how can I make if the condition on the word if it does not exist then add new\_token of the word from the list
