config.json file not available 
Author: andysingal
Pull request: no

### System Info

colab 
notebook: https://colab.research.google.com/drive/118RTcKAQFIICDsgTcabIF-_XKmOgM-cc?usp=sharing

### Who can help?

@sgugger  @younesbelkada

### Information

- [ ] 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

```
RepositoryNotFoundError: 404 Client Error. (Request ID: 
Root=1-64c7ee9d-240cd76b269a914d67b458fa;dcab1901-0ebf-4282-b8a4-9d1e087de5b4)

Repository Not Found for url: https://huggingface.co/None/resolve/main/config.json.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.

During handling of the above exception, another exception occurred:
```

### Expected behavior

https://huggingface.co/Andyrasika/qlora-2-7b-andy giving error: 
```
Andyrasika/qlora-2-7b-andy does not appear to have a file named config.json. Checkout 'https://huggingface.co/Andyrasika/qlora-2-7b-andy/7a0facc5b1f630824ac5b38853dec5e988a5569e' for available files.
```

Comments:
Hi @andysingal 
it seems you are trying to load an adapter model. You can load it with

```python
from peft import AutoPeftModelForCausalLM

model = AutoPeftModelForCausalLM.from_pretrained("Andyrasika/qlora-2-7b-andy")
```

If you want to load the base model in 4bit:

```python
from peft import AutoPeftModelForCausalLM

model = AutoPeftModelForCausalLM.from_pretrained("Andyrasika/qlora-2-7b-andy", load_in_4bit=True)
```

Once https://github.com/huggingface/transformers/pull/25077 will get merged you'll be able to load the model directly with `AutoModelForCausalLM`.

Thanks for your email. But why am I getting the error message?. I already
have adapter_config. JSON .

On Mon, Jul 31, 2023 at 23:09 Younes Belkada ***@***.***>
wrote:

> Hi @andysingal <https://github.com/andysingal>
> it seems you are trying to load an adapter model. You can load it with
>
> from peft import AutoPeftModelForCausalLM
> model = AutoPeftModelForCausalLM.from_pretrained("Andyrasika/qlora-2-7b-andy")
>
> If you want to load the base model in 4bit:
>
> from peft import AutoPeftModelForCausalLM
> model = AutoPeftModelForCausalLM.from_pretrained("Andyrasika/qlora-2-7b-andy", load_in_4bit=True)
>
> Once #25077 <https://github.com/huggingface/transformers/pull/25077> will
> get merged you'll be able to load the model directly with
> AutoModelForCausalLM.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/transformers/issues/25215#issuecomment-1658859481>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE4LJNPF5H4NF3BC4XKTXL3XS7UUDANCNFSM6AAAAAA26SP5AE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>


Hi @andysingal 
It is because `AutoModelForCausalLM` will look if there is any `config.json` file present on that model folder and not `adapter_config.json` which are two different file names

When you run the model created it gives the same error. Assume I am making
an error in the notebook, but inference does not need to show the error on
your website?
Please advise on how to fix it?

On Mon, Jul 31, 2023 at 23:22 Younes Belkada ***@***.***>
wrote:

> Hi @andysingal <https://github.com/andysingal>
> It is because AutoModelForCausalLM will look if there is any config.json
> file present on that model folder and not adapter_config.json which are
> two different file names
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/transformers/issues/25215#issuecomment-1658883214>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE4LJNK3H374C3UHR2ZABBTXS7WF7ANCNFSM6AAAAAA26SP5AE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>


@younesbelkada Any updates?

Hi @andysingal 
Thanks for the ping, as stated above, in your repository only adapter weights and config are stored. Currently it is not supported to load apapted models directly using `AutoModelForCausalLM.from_pretrained(xxx)`, please refer to this comment https://github.com/huggingface/transformers/issues/25215#issuecomment-1658859481 to effectively load the adapted model using PEFT library.

> 

Thanks @younesbelkada for your instant reply. My question is when i compute Text generation inference on your website it gives that error. **I understand i need to use peft for loading the adpater and config files using peft in my preferred env**

Looking forward to hearing from you @ArthurZucker 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

> > 
> 
> Thanks @younesbelkada for your instant reply. My question is when i compute Text generation inference on your website it gives that error. **I understand i need to use peft for loading the adpater and config files using peft in my preferred env**
> 
> Looking forward to hearing from you @ArthurZucker

you may need to load the lora_adapter into model using the the following code
```python
model = AutoModelForCausalLM.from_pretrained("./original_model_path ", trust_remote_code=True)
model = PeftModel.from_pretrained(model, "./lora_model_path")
```

Im running into the same issue through the user interface

it is throwing the same OS error even with 
`model = AutoPeftModelForCausalLM.from_pretrained("Andyrasika/qlora-2-7b-andy"`

![image_2024-03-25_160246364](https://github.com/huggingface/transformers/assets/115806011/fa7e2219-96cf-4c5c-939e-c87d55260470)
Same problem here, anyone has solved ?