# Missing config.json file after AutoTraining

**URL:** <https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609>\
**Category:** Beginners\
**Created:** [October 15, 2023, 8:11am UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609 "2023-10-15T08:11:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kabatubare](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@Kabatubare](https://discuss.huggingface.co/u/Kabatubare)\
**Post date:** [October 15, 2023, 8:11am UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/1 "2023-10-15T08:11:01Z")

</div>

Detailed Problem Summary

**Context:**

- **Environment** : Google Colab (Pro Version using a V100) for training.
- **Tool** : Utilizing Hugging Face AutoTrain for fine-tuning a language model.

**Sequence of Events:**

1. **Initial Training** :

- Successfully trained a model using AutoTrain.
- Process seemingly completed without errors, resulting in several output files.

1. **Missing `config.json`** :

- Despite successful training, noticed that the `config.json` file was not generated.
- Without `config.json`, the trained model cannot be loaded for inference or further training.

1. **Manual Configuration** :

- Created a `config.json` manually based on a the ‘base model’ used for fine-tuning (NousResearch/Llama-2-7b-chat-hf) plus additional training and adapter parameters derived from the fine-tuned model’s files AutoTrain uploads to the HF repository.
- Uploaded this `config.json` to the Hugging Face repository where the model resides.

1. **Upload to Repository** :

- Uploaded all relevant files, including `pytorch_model.bin`, `adapter_config.json`, `adapter_model.bin`, and others, to a Hugging Face repository named `Kabatubare/meta_douglas_2`.

1. **Model Loading Error** :

- Attempted to load the model and encountered the following error:

vbnetCopy code

```auto
OSError: Kabatubare/meta_douglas_2 does not appear to have a file named pytorch_model.bin, tf_model.h5, model.ckpt, or flax_model.msgpack.

```

1. **File Size Anomaly** :

- Noticed that the size of the uploaded `pytorch_model.bin` is only 888 Bytes, which is far smaller than what is typical for such files.

**Repository File Structure:**

- `adapter_config.json`
- `adapter_model.bin`
- `added_tokens.json`
- `config.json` (manually added)
- `pytorch_model.bin` (888 Bytes, suspected to be incorrect or incomplete)
- Tokenizer files (`tokenizer.json`, `tokenizer.model`, etc.)
- Training parameters (`training_args.bin`, `training_params.json`)

**Specific Questions for the Hugging Face Community:**

1. **Configuration File** : Why is a `config.json` not generated by AutoTrain by default? Is there a specific setting or flag that needs to be enabled to output this file?
2. **File Size Issue** :

- What could cause `pytorch_model.bin` to be so small (888 Bytes)?
- Could this be a symptom of an incomplete or failed save operation?

1. **Manual Configuration** :

- Are there standard procedures or checks to verify that a manually created `config.json` is accurate?
- Are there tools to validate the `config.json` against the actual PyTorch model file?

1. **Error Resolution** :

- How to resolve the `OSError` encountered while loading the model?
- Are there specific requirements for the directory structure when loading models from a Hugging Face repository?

1. **Model Integrity** :

- Given the missing `config.json` and the small size of `pytorch_model.bin`, are there steps to verify the integrity of the trained model?

---

<div class="post-metadata">

**Author:** ![Bossdude0594](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bossdude0594/32/21121_2.png) [@Bossdude0594](https://discuss.huggingface.co/u/Bossdude0594)\
**Post date:** [November 11, 2023, 5:56pm UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/2 "2023-11-11T17:56:57Z")

</div>

Hi, were you able to ever solve your problem? I have the same issue after using autotrain and there is no config.json file

---

<div class="post-metadata">

**Author:** ![beeezeee](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@beeezeee](https://discuss.huggingface.co/u/beeezeee)\
**Post date:** [November 11, 2023, 8:21pm UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/3 "2023-11-11T20:21:53Z")

</div>

I think your adapter\_model.bin is your pytorch\_model.bin, just need to rename it maybe.

---

<div class="post-metadata">

**Author:** ![manjunathshiva](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/manjunathshiva/32/22256_2.png) [@manjunathshiva](https://discuss.huggingface.co/u/manjunathshiva)\
**Post date:** [December 19, 2023, 12:07pm UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/4 "2023-12-19T12:07:11Z")

</div>

I have the exact same issue! Any update on this ?

---

<div class="post-metadata">

**Author:** ![FDeRubeis](https://avatars.discourse-cdn.com/v4/letter/f/58956e/32.png) [@FDeRubeis](https://discuss.huggingface.co/u/FDeRubeis)\
**Post date:** [February 28, 2024, 5:29pm UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/5 "2024-02-28T17:29:42Z")

</div>

For those still wondering, I found this answer helpful:

> [@After autotrain and push the files to the repo, there is no config file](https://discuss.huggingface.co/t/after-autotrain-and-push-the-files-to-the-repo-there-is-no-config-file/52490/):
>
> Hi there, I used below command and in the colab I had the project folder which is same as the huggingface repo I pushed. But when I tried to use it . I got the error. !autotrain llm --train --project\_name my-llm-test --model meta-llama/Llama-2-7b-hf --data\_path test --use\_peft --use\_int4 --learning\_rate 2e-4 --train\_batch\_size 12 --num\_train\_epochs 3 --trainer sft --push\_to\_hub --repo\_id youshikyou/ly\_ai from transformers import AutoModelForSeq2SeqLM,AutoTokenizer tokenizer = AutoTokenizer.fr…

In other words, by training with PeFT, you haven’t saved the whole model, but only the parameters that were updated by LoRA. This is called the “adapter model”. In order to run the inference one the whole fine-tuned model, you need to merge the adapter model with the original base model. [Here](https://huggingface.co/docs/hub/peft) is a guide to do it on your local machine.

However, if you want to run the inference API, you can use a library that was made on purpose, called [peft](https://github.com/huggingface/peft/issues/370#issuecomment-1601066539). In order to activate it, you need to specify it on [the README of your uploaded model](https://huggingface.co/docs/hub/peft).

Currently there is a problem: if the base model needs an authentication token (e.g. LLama2), it won’t work: this is because the Peft inference API struggles to use your token to fetch the base model. Maybe I am doing something wrong, but in the end I didn’t manage to make it work. If someone finds a solution I would love to know.

Disclaimer: I am not an expert, I am a beginner. Just trying to save some other people the hassle I went through to find it out '-\_-

---

<div class="post-metadata">

**Author:** ![nadav-sellence](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@nadav-sellence](https://discuss.huggingface.co/u/nadav-sellence)\
**Post date:** [March 13, 2024, 10:17am UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/6 "2024-03-13T10:17:33Z")

</div>

Hi,

[ISSUE]: **{model\_name} does not appear to have a file named \_config.json**

Any updates from the HuggingFace team? @sgugger

I’m having the same issue.  
**Step 1:** (using HF Spaces AutoTrain GUI)  
I fine-tuned _mistralai/Mixtral-8x7B-Instruct-v0.1_ on my data using SFT.

**Step2:** (using HF Spaces AutoTrain GUI)  
I’m trying to further fine-tune my SFT fine-tuned model on my data using DPO now.

**Step3:** (using HF Spaces AutoTrain GUI)  
In the _APP_ pane I upload my _train.csv_ and click on **Start Training**

**Step 4:** I get back the following error  
“”"  
❌ ERROR | 2024-03-13 09:41:28 | autotrain.trainers.common:wrapper:92 - xxxxx/autotrain-xxxxx-xxxxx does not appear to have a file named _config.json._ Checkout ‘[https://huggingface.co/xxxxx-xxxxx/autotrain-xxxxx-xxxxx/main](https://huggingface.co/xxxxx-xxxxx/autotrain-xxxxx-xxxxx/main)’ for available files.  
“”"

Doesn’t the _config.json_ file get generated automatically when using AutoTrain? Should I create it myself? I’m not sure how. Is there a specific documentation page on the issue?

@sgugger could you please assist?

Many thanks 🙏🏻

---

<div class="post-metadata">

**Author:** ![mohankrishnan](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@mohankrishnan](https://discuss.huggingface.co/u/mohankrishnan)\
**Post date:** [April 3, 2024, 2:58am UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/7 "2024-04-03T02:58:09Z")

</div>

I’m getting the same error, do you fix that problem @nadav-sellence?

---

<div class="post-metadata">

**Author:** ![jaiyu](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jaiyu](https://discuss.huggingface.co/u/jaiyu)\
**Post date:** [April 10, 2024, 3:38pm UTC](https://discuss.huggingface.co/t/missing-config-json-file-after-autotraining/58609/8 "2024-04-10T15:38:00Z")

</div>

Thanks! That worked.
