# Unable to load model from HUB

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-load-model-from-hub%2F90383%3E%5C
**Category:** Beginners\
**Created:** [June 5, 2024, 4:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-load-model-from-hub%2F90383 "2024-06-05T04:09:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nishanth7803](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nishanth7803](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNishanth7803)%5C
**Post date:** [June 5, 2024, 4:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Funable-to-load-model-from-hub%2F90383%2F1 "2024-06-05T04:09:35Z")

</div>

Hello there!  
I’am trying to build a basic RAG application using llama\_index. I’m unable to load the LLama2 model from huggingface. The code Iam using is:

llm = HuggingFaceLLM(  
context\_window = 4096,  
max\_new\_tokens = 256,  
generate\_kwargs = {“temperature”: 0.0, “do\_sample”:False},  
system\_prompt = system\_prompt,  
query\_wrapper\_prompt = query\_wrapper\_prompt,  
tokenizer\_name = “meta-llama/Llama-2-7b-chat-hf”,  
model\_name = “meta-llama/Llama-2-7b-chat-hf”,  
device\_map = “auto”,  
model\_kwargs = {“torch\_dtype”: torch.float16, “load\_in\_8bit”: True},  
)

I made sure of logging into huggingface f=befor executing this. The error Iam getting is:

OSError: We couldn’t connect to ‘[https://huggingface.co](https://huggingface.co/)’ to load this file, couldn’t find it in the cached files and it looks like meta-llama/Llama-2-7b-chat-hf is not the path to a directory containing a file named config.json. Checkout your internet connection or see how to run the library in offline mode at ‘[Installation](https://huggingface.co/docs/transformers/installation#offline-mode)’.
