# Inference Issue with Llama Models using HF Inference

**URL:** <https://discuss.huggingface.co/t/inference-issue-with-llama-models-using-hf-inference/139207>\
**Category:** Beginners\
**Created:** [February 5, 2025, 10:00pm UTC](https://discuss.huggingface.co/t/inference-issue-with-llama-models-using-hf-inference/139207 "2025-02-05T22:00:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![batharun2](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@batharun2](https://discuss.huggingface.co/u/batharun2)\
**Post date:** [February 5, 2025, 10:00pm UTC](https://discuss.huggingface.co/t/inference-issue-with-llama-models-using-hf-inference/139207/1 "2025-02-05T22:00:17Z")

</div>

Hello All,  
Please pardon for my basic/trivial questions, still i am in learning phase.

Context:  
I used Autotrain to train meta-llama/Llama-3.2-1B (i have access to this model).  
Autrain completed succesfully.  
I want to test using HF Inference Endpoint option available from fine tuned model. I am getting following error and not sure how to resolve this issue.  
Appreciate your help on this.

Thank you!

==============error================  
Exit code: 3. Reason: File “/app/huggingface\_inference\_toolkit/handler.py”, line 22, in **init**  
self.pipeline = get\_pipeline(  
^^^^^^^^^^^^^  
File “/app/huggingface\_inference\_toolkit/utils.py”, line 252, in get\_pipeline  
hf\_pipeline = pipeline(task=task, model=model\_dir, device=device, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/transformers/pipelines/ **init**.py”, line 849, in pipeline  
config = AutoConfig.from\_pretrained(  
^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/transformers/models/auto/configuration\_auto.py”, line 1054, in from\_pretrained  
config\_dict, unused\_kwargs = PretrainedConfig.get\_config\_dict(pretrained\_model\_name\_or\_path, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/transformers/configuration\_utils.py”, line 591, in get\_config\_dict  
config\_dict, kwargs = cls.\_get\_config\_dict(pretrained\_model\_name\_or\_path, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/transformers/configuration\_utils.py”, line 650, in \_get\_config\_dict  
resolved\_config\_file = cached\_file(  
^^^^^^^^^^^^  
File “/usr/local/lib/python3.11/dist-packages/transformers/utils/hub.py”, line 421, in cached\_file  
raise EnvironmentError(  
OSError: You are trying to access a gated repo.  
Make sure to have access to it at [meta-llama/Llama-3.2-1B · Hugging Face](https://huggingface.co/meta-llama/Llama-3.2-1B).  
401 Client Error. (Request ID: Root=1-67a3db7b-5d79316f2004d07c068598e2;57232df2-b5bf-4ca0-b882-4b0a4cfc1100)

Cannot access gated repo for url [https://huggingface.co/meta-llama/Llama-3.2-1B/resolve/main/config.json](https://huggingface.co/meta-llama/Llama-3.2-1B/resolve/main/config.json).  
Access to model meta-llama/Llama-3.2-1B is restricted. You must have access to it and be authenticated to access it. Please log in.

Application startup failed. Exiting.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [February 6, 2025, 6:37am UTC](https://discuss.huggingface.co/t/inference-issue-with-llama-models-using-hf-inference/139207/2 "2025-02-06T06:37:19Z")

</div>

When loading a trained model (difference), it seems that an error occurs because it needs to refer to the original model. In short, it can be fixed by passing a token. There are several ways to do this, such as passing it directly with **token=** or executing **login()** in advance.

> **[User access tokens](https://huggingface.co/docs/hub/security-tokens)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Quickstart](https://huggingface.co/docs/huggingface_hub/main/quick-start#authentication)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
