# (Memory) error when trying to use AutoModel.from\_pretrained

**URL:** <https://discuss.huggingface.co/t/memory-error-when-trying-to-use-automodel-from-pretrained/65861>\
**Category:** Beginners\
**Created:** [December 14, 2023, 6:17pm UTC](https://discuss.huggingface.co/t/memory-error-when-trying-to-use-automodel-from-pretrained/65861 "2023-12-14T18:17:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninahaller](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@ninahaller](https://discuss.huggingface.co/u/ninahaller)\
**Post date:** [December 14, 2023, 6:17pm UTC](https://discuss.huggingface.co/t/memory-error-when-trying-to-use-automodel-from-pretrained/65861/1 "2023-12-14T18:17:24Z")

</div>

Hi,

I am trying to load the Asclepius-7B model using Transformers and the following code.

```auto
from transformers import AutoTokenizer, AutoModel

tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama2-7B")
model = AutoModel.from_pretrained("starmpcc/Asclepius-Llama2-7B")

```

The loading does not finish however and the process is killed with the error message / warning:

UserWarning: resource\_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown

I am trying to load it on my MacBook Pro with 8GB memory without GPU. My guess is, it is a memory problem. Is there a way I can use it anyway on my local computer?  
If not, can I use something like a virtual machine to get access to more memory?

Thanks in advance  
Nina
