# AutoTokenizer keeps redownloading

**URL:** <https://discuss.huggingface.co/t/autotokenizer-keeps-redownloading/77098>\
**Category:** Beginners\
**Created:** [March 12, 2024, 3:03pm UTC](https://discuss.huggingface.co/t/autotokenizer-keeps-redownloading/77098 "2024-03-12T15:03:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zilong](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/zilong/32/36830_2.png) [@zilong](https://discuss.huggingface.co/u/zilong)\
**Post date:** [March 12, 2024, 3:03pm UTC](https://discuss.huggingface.co/t/autotokenizer-keeps-redownloading/77098/1 "2024-03-12T15:03:16Z")

</div>

Everytime I instantiate the tokenizer using

```auto
self.tokenizer = AutoTokenizer.from_pretrained("'sentence-transformers/all-MiniLM-L12-v2'")

```

it calls to huggingface to download the tokenizer:

> [connectionpool.py:474] - [https://huggingface.co:443](https://huggingface.co:443) "HEAD /sentence-transformers/all-MiniLM-L12-v2/resolve/main

It seems it is not being cached locally and you cannot specify a `cache_dir` for the tokenizer. You can with `AutoModel`, but not with `AutoTokenizer` How do I prevent this?

---

<div class="post-metadata">

**Author:** ![Sandy1857](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@Sandy1857](https://discuss.huggingface.co/u/Sandy1857)\
**Post date:** [March 13, 2024, 2:48pm UTC](https://discuss.huggingface.co/t/autotokenizer-keeps-redownloading/77098/2 "2024-03-13T14:48:37Z")

</div>

You could use tokenizer.save\_pretrained() for the same
