# LLAMA-2 Download issues

**URL:** <https://discuss.huggingface.co/t/llama-2-download-issues/48731>\
**Category:** Models\
**Created:** [July 30, 2023, 9:17pm UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731 "2023-07-30T21:17:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaviobrio](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@flaviobrio](https://discuss.huggingface.co/u/flaviobrio)\
**Post date:** [July 30, 2023, 9:17pm UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/1 "2023-07-30T21:17:47Z")

</div>

Hello everyone,  
I have been trying to use Llama 2 with the following code:

```auto
from langchain.llms import HuggingFaceHub 

google_kwargs = {'temperature':0.6, 'max_length': 64}
llm = HuggingFaceHub(repo_id='meta-llama/Llama-2-7b-chat', huggingfacehub_api_token=hugging_face_token, model_kwargs=google_kwargs) 
name = llm('I want to open an Italian restaurant, suggest me a name for this')
print(name)

```

By the way, every time I got the following error:

ValueError: Error raised by inference API: meta-llama/Llama-2-7b-chat does not appear to have a file named config.json. Checkout ‘[https://huggingface.co/meta-llama/Llama-2-7b-chat/2abbae1937452ebd4eecb63113a87feacd6f13ac](https://huggingface.co/meta-llama/Llama-2-7b-chat/2abbae1937452ebd4eecb63113a87feacd6f13ac)’ for available files.

I have been authorized by both META and HuggingFace, but I cannot do anything.  
The problem is the same when I use the meta-llama/Llama-2-7b-chat-hf version, in that case it says that I must obtain the PRO version.  
Is there a way to fix it?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![Chelcie](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Chelcie](https://discuss.huggingface.co/u/Chelcie)\
**Post date:** [July 31, 2023, 6:44am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/2 "2023-07-31T06:44:45Z")

</div>

Llama 2 doesn’t seem to support the Inference API, so you may have to pay to use this specific version of the model. Do you already have a PRO account? Otherwise, I don’t believe there’s anyway to bypass the issue

---

<div class="post-metadata">

**Author:** ![flaviobrio](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@flaviobrio](https://discuss.huggingface.co/u/flaviobrio)\
**Post date:** [July 31, 2023, 6:58am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/3 "2023-07-31T06:58:03Z")

</div>

And what to do with the normal one, without hf?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![MLconArtist](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@MLconArtist](https://discuss.huggingface.co/u/MLconArtist)\
**Post date:** [August 11, 2023, 6:04am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/4 "2023-08-11T06:04:05Z")

</div>

You’ll have to login with hf\_token before you can access gated models, and this is assuming that you’ve been granted access to those gated models.

---

<div class="post-metadata">

**Author:** ![flaviobrio](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@flaviobrio](https://discuss.huggingface.co/u/flaviobrio)\
**Post date:** [August 11, 2023, 11:06am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/5 "2023-08-11T11:06:07Z")

</div>

When I try the access from the command line it gives me problems

---

<div class="post-metadata">

**Author:** ![MLconArtist](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@MLconArtist](https://discuss.huggingface.co/u/MLconArtist)\
**Post date:** [September 7, 2023, 5:49am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/6 "2023-09-07T05:49:38Z")

</div>

from huggingface\_hub import snapshot\_download, login

# login and download

login(token = “hf\_token”)

snapshot\_download(repo\_id=“repo-id”, local\_dir= dir\_path")

Use this code in a python file and run it. This should mostly work.

Sorry for the late reply.

---

<div class="post-metadata">

**Author:** ![flaviobrio](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@flaviobrio](https://discuss.huggingface.co/u/flaviobrio)\
**Post date:** [September 28, 2023, 9:31am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/7 "2023-09-28T09:31:54Z")

</div>

Hello, many thanks for your reply. Can I ask you how can import it once I did the download?

---

<div class="post-metadata">

**Author:** ![flaviobrio](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@flaviobrio](https://discuss.huggingface.co/u/flaviobrio)\
**Post date:** [September 28, 2023, 9:40am UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/8 "2023-09-28T09:40:12Z")

</div>

> [@flaviobrio](#):
>
> ```auto
> llm = HuggingFaceHub(repo_id='meta-llama/Llama-2-7b-chat', huggingfacehub_api_token=hugging_face_token, model_kwargs=google_kwargs) 
> name = llm('I want to open an Italian restaurant, suggest me a name for this')
> print(name)
> 
> ```

I did it and the code returns me the same .json missing file error.

---

<div class="post-metadata">

**Author:** ![nevakrien](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nevakrien](https://discuss.huggingface.co/u/nevakrien)\
**Post date:** [November 7, 2023, 5:24pm UTC](https://discuss.huggingface.co/t/llama-2-download-issues/48731/9 "2023-11-07T17:24:12Z")

</div>

is this the type of thing we could just fix by manualy adding a config?
