# AutoTokenizer keeps redownloading

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotokenizer-keeps-redownloading%2F77098%3E%5C
**Category:** Beginners\
**Created:** [March 12, 2024, 3:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotokenizer-keeps-redownloading%2F77098 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fzilong)%5C
**Post date:** [March 12, 2024, 3:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotokenizer-keeps-redownloading%2F77098%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FSandy1857)%5C
**Post date:** [March 13, 2024, 2:48pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fautotokenizer-keeps-redownloading%2F77098%2F2 "2024-03-13T14:48:37Z")

</div>

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