# The memory usage about inference on CPU

**URL:** <https://discuss.huggingface.co/t/the-memory-usage-about-inference-on-cpu/128786>\
**Category:** Beginners\
**Created:** [December 2, 2024, 6:50am UTC](https://discuss.huggingface.co/t/the-memory-usage-about-inference-on-cpu/128786 "2024-12-02T06:50:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumuyou](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@sumuyou](https://discuss.huggingface.co/u/sumuyou)\
**Post date:** [December 2, 2024, 6:50am UTC](https://discuss.huggingface.co/t/the-memory-usage-about-inference-on-cpu/128786/1 "2024-12-02T06:50:04Z")

</div>

I download a GPT2-3.5B model from huggingface，here is the files

 ![f978a43c3e8531b02d54dcae5b4346bb](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/b/8b40a1650c349fd3e08d8b41a1db63b88e27d1a0.png)  
I load the model just using `GPT2LMHeadModel.from_pretrained(path)`，the memory usage of CPU during inference is 14GB，but after i save the model using `model.save_pretrained()` to a new folder, then i load it to inference, the memory usage is only 1GB. I test .safetensors and .bin, and get the same result
