# Why does local-downloaded model files are different from those in huggingface?

**URL:** <https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247>\
**Category:** Beginners\
**Created:** [June 10, 2024, 6:18am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247 "2024-06-10T06:18:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzongE](https://avatars.discourse-cdn.com/v4/letter/z/b9bd4f/32.png) [@zzongE](https://discuss.huggingface.co/u/zzongE)\
**Post date:** [June 10, 2024, 6:18am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/1 "2024-06-10T06:18:29Z")

</div>

I downloaded model to my local PC and saved it using the following codes.

Codes:

```auto
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "beomi/Llama-3-Open-Ko-8B"

model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)

model.save_pretrained("./path/to/model")
tokenizer.save_pretrained("./path/to/model")

```

Results:

```auto
Downloading shards: 100%|██████████| 6/6 [02:50<00:00, 28.42s/it]
Loading checkpoint shards: 100%|██████████| 6/6 [00:06<00:00, 1.01s/it]
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.

```

The actual model files uploaded in huggingface([beomi/Llama-3-Open-Ko-8B at main](https://huggingface.co/beomi/Llama-3-Open-Ko-8B/tree/main)) has 6 model shards and each of model.safetensors filesize does not exceed 3GB,

while the files in my local PC does not match in the filesize or neither in the number of files.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/9/4907e234373eb96a6e5492dabf1ffc47c2a67341.png)

Can anyone explain this situation or the way to solve the problem?

Thank you in advance

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [June 10, 2024, 7:15am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/2 "2024-06-10T07:15:33Z")

</div>

Hi,

One can specify a `max_shard_size` when using the `from_pretrained` or `push_to_hub` methods, which defaults to 5 GB: [Models](https://huggingface.co/docs/transformers/v4.41.3/en/main_classes/model#transformers.PreTrainedModel.push_to_hub)

---

<div class="post-metadata">

**Author:** ![zzongE](https://avatars.discourse-cdn.com/v4/letter/z/b9bd4f/32.png) [@zzongE](https://discuss.huggingface.co/u/zzongE)\
**Post date:** [June 10, 2024, 7:24am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/3 "2024-06-10T07:24:29Z")

</div>

Thank you.

But the thing I am curious about is that the model files in huggingface, the sizes are sum to less than 17GB as below.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/c/5/c5d855166e5e7c82e9c696b720bed14d1834a9dc.png)

while the sum of the model files i have downloaded in the local, is more than 30GB.

How can the size of models be changed?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [June 10, 2024, 7:33am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/4 "2024-06-10T07:33:03Z")

</div>

By default, a precision of float32 (32 bits or 4 bytes per parameter) is used. Hence, as [beomi/Llama-3-Open-Ko-8B · Hugging Face](https://huggingface.co/beomi/Llama-3-Open-Ko-8B) has 8 billion parameters, that’s 8\*4 = 32 GB.

If you load in half-precision (bfloat16 or 2 bytes per parameter) then you’ll get 8\*2 = 16 GB.

---

<div class="post-metadata">

**Author:** ![zzongE](https://avatars.discourse-cdn.com/v4/letter/z/b9bd4f/32.png) [@zzongE](https://discuss.huggingface.co/u/zzongE)\
**Post date:** [June 10, 2024, 7:36am UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/5 "2024-06-10T07:36:35Z")

</div>

100 % understood, appreciate!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [June 10, 2024, 7:36pm UTC](https://discuss.huggingface.co/t/why-does-local-downloaded-model-files-are-different-from-those-in-huggingface/91247/6 "2024-06-10T19:36:36Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
