Can not find adapter_config.json using PeftConfig.from_pretrained
I have a huggingface spaces streamlit filehttps://huggingface.co/spaces/foobar8675/bloom-7b1-lora-tagger/blob/main/app.pywhich is throwing an errorValueError: Can't find 'adapter_config.json' at 'foobar8675/bloom-7b1-lora-tagger'
Traceback:
File "/home/user/.local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
File "/home/user/app/app.py", line 23, in <module>
    config = PeftConfig.from_pretrained(peft_model_id)
File "/home/user/.local/lib/python3.10/site-packages/peft/utils/config.py", line 108, in from_pretrained
    raise ValueError(f"Can't find '{CONFIG_NAME}' at '{pretrained_model_name_or_paon this linepeft_model_id = "foobar8675/bloom-7b1-lora-tagger"
config = PeftConfig.from_pretrained(peft_model_id)the model at foobar8675/bloom-7b1-lora-tagger is public and I verified the adapter_config.json is on the model. i’m quite confused as to why this is happening and any help is appreciated.
2023-06-05T07:47:58Z
Hi, I have the same problem with themodel bofenghuang/vigogne-chat-7b. While exporting it, it throws anValueError: Can’t find ‘adapter_config.json’even if the file exists.
2023-06-05T10:21:23Z
i have the same issue for inference.ValueError: Can’t find ‘adapter_config.json’ at ‘kirilzilla/alpaca-SGD’
2023-06-06T14:07:08Z
i have the same problem using the file “generate.py” of alpaca-lora repository (GitHub) which calls a file in Peft repository.
2023-06-07T11:27:54Z
I have the same issue as well.  Can any one help?
2023-07-07T07:39:10Z
Hey all,For me the issue was authentication. Running through the stacktrace, if you see something like “Invalid username and password” just after a link to the adapter_config.json file, it’s likely you have the same issue too.To fix, you’ll need to login to the hub, which can be done programatically using the following snippet:from huggingface_hub import login
import os

access_token = os.environ["HUGGING_FACE_HUB_TOKEN"]
login(token=access_token)Hope this helps!
2024-01-23T10:28:12Z
use thismodel.config.to_json_file(“adapter_config.json”)thenmodel.push_to_hub(“model name”)
2024-05-05T05:05:52Z
For whom having this issue while doing SFT, in my case it was because I omittedget_peft_modelbeforeSFTTrainer. Per HF docs,get_peft_modelwraps base model and peft_config intoPeftModel. So if you don’t doget_peft_model,modelwould be justAutoCasualLMnotAutoPeftCasualLM. Therefore, when to domodel.push_to_hub, the files being uploaded will bemodel.safetensorsandconfig.json, notadapter_config.jsonandadapter_model.safetensors.
2024-07-11T07:11:44Z
from huggingface_hub import notebook_login
notebook_login()or use thisos.environ["HUGGINGFACE_TOKEN"] = "huggingface token"!huggingface-cli login --token $HUGGINGFACE_TOKENthis worked for me, thanks