# Getting error while loading model from local path : Exception: expected value at line 1 column 1

**URL:** <https://discuss.huggingface.co/t/getting-error-while-loading-model-from-local-path-exception-expected-value-at-line-1-column-1/102981>\
**Category:** 🤗Transformers\
**Created:** [August 19, 2024, 12:07pm UTC](https://discuss.huggingface.co/t/getting-error-while-loading-model-from-local-path-exception-expected-value-at-line-1-column-1/102981 "2024-08-19T12:07:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![InderV94](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@InderV94](https://discuss.huggingface.co/u/InderV94)\
**Post date:** [August 19, 2024, 12:07pm UTC](https://discuss.huggingface.co/t/getting-error-while-loading-model-from-local-path-exception-expected-value-at-line-1-column-1/102981/1 "2024-08-19T12:07:47Z")

</div>

I created a tar file out of a unsloth fine-tuned model(base-model: unsloth/gemma-2b-bnb-4bit) using PEFT and pushed it to gcsBucket. I am downloading the artifacts from gcs bucket, extracting the files and locally saving them into a folder. Now, I am trying to load the model using this local directory path, but getting error : Exception: expected value at line 1 column 1

```auto
 model, tokenizer = FastLanguageModel.from_pretrained(
    model_name ='./model',
    max_seq_length = max_seq_length,
    dtype = None,
    load_in_4bit = True,
    local_files_only = True,
  )
 FastLanguageModel.for_inference(model)

```

How can I load the model from the given directory?

---

<div class="post-metadata">

**Author:** ![mahmutc](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mahmutc/32/52583_2.png) [@mahmutc](https://discuss.huggingface.co/u/mahmutc)\
**Post date:** [August 20, 2024, 9:36am UTC](https://discuss.huggingface.co/t/getting-error-while-loading-model-from-local-path-exception-expected-value-at-line-1-column-1/102981/2 "2024-08-20T09:36:45Z")

</div>

> [@InderV94](#):
>
> I am downloading the artifacts from gcs bucket, extracting the files and locally saving them into a folder.

You might have some issues with this process. Can you please check the size of config.json, tokenizer.json and tokenizer.model:

> <https://github.com/huggingface/transformers/issues/22389>
>
> \### System Info
> 
> \- \`transformers\` version: 4.28.0.dev0
> \- Platform: Linux-5.4.0-…144-generic-x86\_64-with-glibc2.31
> \- Python version: 3.9.16
> \- Huggingface\_hub version: 0.13.2
> \- PyTorch version (GPU?): 2.0.0+cu117 (True)
> \- Tensorflow version (GPU?): not installed (NA)
> \- Flax version (CPU?/GPU?/TPU?): not installed (NA)
> \- Jax version: not installed
> \- JaxLib version: not installed
> \- Using GPU in script?: \<fill in\>
> \- Using distributed or parallel set-up in script?: \<fill in\>
> 
> 
> \### Who can help?
> 
> @ArthurZucker
> @sgugger
> @gante
> 
> \### Information
> 
> \- \[X\] The official example scripts
> \- \[\] My own modified scripts
> 
> \### Tasks
> 
> \- \[\] An officially supported task in the \`examples\` folder (such as GLUE/SQuAD, ...)
> \- \[\] My own task or dataset (give details below)
> 
> \### Reproduction
> 
> File "/mnt1/wcp/BEELE/BELLE-main/generate\_instruction.py", line 28, in
> tokenizer = AutoTokenizer.from\_pretrained(checkpoint)
> File "/home/appuser/miniconda3/envs/wcppy39/lib/python3.9/site-packages/transformers/models/auto/tokenization\_auto.py", line 679, in from\_pretrained
> return tokenizer\_class.from\_pretrained(pretrained\_model\_name\_or\_path, \*inputs, \*\*kwargs)
> File "/home/appuser/miniconda3/envs/wcppy39/lib/python3.9/site-packages/transformers/tokenization\_utils\_base.py", line 1804, in from\_pretrained
> return cls.\_from\_pretrained(
> File "/home/appuser/miniconda3/envs/wcppy39/lib/python3.9/site-packages/transformers/tokenization\_utils\_base.py", line 1958, in \_from\_pretrained
> tokenizer = cls(\*init\_inputs, \*\*init\_kwargs)
> File "/home/appuser/miniconda3/envs/wcppy39/lib/python3.9/site-packages/transformers/models/bloom/tokenization\_bloom\_fast.py", line 118, in init
> super().init(
> File "/home/appuser/miniconda3/envs/wcppy39/lib/python3.9/site-packages/transformers/tokenization\_utils\_fast.py", line 111, in init
> fast\_tokenizer = TokenizerFast.from\_file(fast\_tokenizer\_file)
> Exception: expected value at line 1 column 1
> 
> \### Expected behavior
> 
> i hope the file is run

---

<div class="post-metadata">

**Author:** ![InderV94](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@InderV94](https://discuss.huggingface.co/u/InderV94)\
**Post date:** [August 20, 2024, 10:08am UTC](https://discuss.huggingface.co/t/getting-error-while-loading-model-from-local-path-exception-expected-value-at-line-1-column-1/102981/3 "2024-08-20T10:08:34Z")

</div>

All the model files are of valid size. Interestingly creating a zip and unzipping it back is doing all the magic.If I simply do git clone \<huggingface\_model\_uri\> and then provide the local path while loading model it works.
