# Push To Hub (Cloud Train) not working!

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-cloud-train-not-working%2F161958%3E%5C
**Category:** 🤗AutoTrain\
**Created:** [July 6, 2025, 6:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-cloud-train-not-working%2F161958 "2025-07-06T18:20:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devparagiri](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@devparagiri](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdevparagiri)%5C
**Post date:** [July 6, 2025, 6:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-cloud-train-not-working%2F161958%2F1 "2025-07-06T18:20:41Z")

</div>

![Screenshot 2025-07-06 at 2.17.36 PM](https://us1.discourse-cdn.com/hellohellohello/original/3X/0/3/03310211b7ad50da65a6d1c2b5eb1956459e4ed3.png)

I am trying to finetune a small language model on A10 Small and directly push it to hub. Now, the actual finetuning takes place in the custom space created by HF but it FAILS to push the model to the hub.

After some debugging, I noticed that it creates the model repo as soon as the finetune job is created and tries to make it once again when it pushes it to the repo leading to a 409. I’ve attached the exact code below.

```auto
import os

from autotrain.params import LLMTrainingParams
from autotrain.project import AutoTrainProject

from dotenv import load_dotenv

load_dotenv()
print(f"HF_USERNAME: {os.environ.get('HF_USERNAME')}")
print(f"HF_TOKEN: {os.environ.get('HF_TOKEN')}")

params = LLMTrainingParams(
    model="microsoft/Phi-4-mini-instruct",
    data_path="HuggingFaceH4/no_robots",
    chat_template="tokenizer",
    text_column="messages",
    train_split="train",
    trainer="sft",
    epochs=1,
    batch_size=1,
    lr=1e-5,
    peft=True,
    quantization="int4",
    target_modules="all-linear",
    padding="right",
    optimizer="paged_adamw_8bit",
    scheduler="cosine",
    gradient_accumulation=8,
    mixed_precision="bf16",
    merge_adapter=True,
    project_name="test-train-3-v3",
    push_to_hub=True,
    username=os.environ.get("HF_USERNAME"),
    token=os.environ.get("HF_TOKEN"),
)

backend = "spaces-a10g-small"
project = AutoTrainProject(params=params, backend=backend, process=True)
project.create()

```

It would be of great help if someone can guide me with this!

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [July 7, 2025, 4:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-cloud-train-not-working%2F161958%2F2 "2025-07-07T04:02:03Z")

</div>

If updating the library does not fix the problem, it may be a recurrence of a past bug.

```auto
pip install --upgrade autotrain-advanced

```

> <https://github.com/huggingface/autotrain-advanced/issues/206>
>
> I ran autotrain with the following command:
> 
> \`autotrain llm --train --project\_…name 'my-llm' --model meta-llama/Llama-2-7b-chat-hf --data\_path db-atlas/fire\_train --text\_column text --use\_peft --use\_int4 --learning\_rate 2e-4 --train\_batch\_size 10 --num\_train\_epochs 5 --trainer sft --push\_to\_hub --repo\_id db-atlas/fire7b\_0816\`
> 
> The model finished training but it failed while pushing to hub, saying that the repo for the model already existed. This is an error, as no repo with that name existed prior to running the command. After pushing to huggingface fails, the repo has been created but there is only a .gitattributes file in it.
> 
> \`\`\`
> 2023-08-16 09:57:36.426 | INFO | autotrain.trainers.utils:merge\_adapter:161 - Saving target model...
> 2023-08-16 09:57:36.505 | INFO | autotrain.trainers.utils:merge\_adapter:161 - Saving target model...
> 2023-08-16 09:57:36.693 | INFO | autotrain.trainers.utils:merge\_adapter:161 - Saving target model...
> 2023-08-16 09:57:36.718 | INFO | autotrain.trainers.utils:merge\_adapter:161 - Saving target model...
> 2023-08-16 09:57:49.732 | INFO | \_\_main\_\_:train:315 - Pushing model to hub...
> 2023-08-16 09:57:50.156 | INFO | \_\_main\_\_:train:315 - Pushing model to hub...
> 2023-08-16 09:57:50.199 | INFO | \_\_main\_\_:train:315 - Pushing model to hub...
> Traceback (most recent call last):
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 261, in hf\_raise\_for\_status
> response.raise\_for\_status()
> File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise\_for\_status
> raise HTTPError(http\_error\_msg, response=self)
> requests.exceptions.HTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
> File "/usr/lib/python3.10/runpy.py", line 196, in \_run\_module\_as\_main
> return \_run\_code(code, main\_globals, None,
> File "/usr/lib/python3.10/runpy.py", line 86, in \_run\_code
> exec(code, run\_globals)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 325, in \<module\>
> train(config)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 317, in train
> api.create\_repo(repo\_id=config.repo\_id, repo\_type="model")
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_validators.py", line 118, in \_inner\_fn
> return fn(\*args, \*\*kwargs)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/hf\_api.py", line 2308, in create\_repo
> hf\_raise\_for\_status(r)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 303, in hf\_raise\_for\_status
> raise HfHubHTTPError(str(e), response=response) from e
> huggingface\_hub.utils.\_errors.HfHubHTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create (Request ID: Root=1-64dc9d9e-4074d9e135352e28319225d1;50a7ec5f-cadb-4575-b41e-4bc4ade1ee47)
> 
> You already created this model repo
> Traceback (most recent call last):
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 261, in hf\_raise\_for\_status
> response.raise\_for\_status()
> File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise\_for\_status
> raise HTTPError(http\_error\_msg, response=self)
> requests.exceptions.HTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
> File "/usr/lib/python3.10/runpy.py", line 196, in \_run\_module\_as\_main
> return \_run\_code(code, main\_globals, None,
> File "/usr/lib/python3.10/runpy.py", line 86, in \_run\_code
> exec(code, run\_globals)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 325, in \<module\>
> train(config)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 317, in train
> api.create\_repo(repo\_id=config.repo\_id, repo\_type="model")
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_validators.py", line 118, in \_inner\_fn
> return fn(\*args, \*\*kwargs)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/hf\_api.py", line 2308, in create\_repo
> hf\_raise\_for\_status(r)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 303, in hf\_raise\_for\_status
> raise HfHubHTTPError(str(e), response=response) from e
> huggingface\_hub.utils.\_errors.HfHubHTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create (Request ID: Root=1-64dc9d9e-130414935b46c6d475762dd8;16c642ae-526f-4409-9dd8-10578b87b53a)
> 
> You already created this model repo
> 2023-08-16 09:57:50.810 | INFO | \_\_main\_\_:train:315 - Pushing model to hub...
> Traceback (most recent call last):
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 261, in hf\_raise\_for\_status
> response.raise\_for\_status()
> File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise\_for\_status
> raise HTTPError(http\_error\_msg, response=self)
> requests.exceptions.HTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
> File "/usr/lib/python3.10/runpy.py", line 196, in \_run\_module\_as\_main
> return \_run\_code(code, main\_globals, None,
> File "/usr/lib/python3.10/runpy.py", line 86, in \_run\_code
> exec(code, run\_globals)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 325, in \<module\>
> train(config)
> File "/usr/local/lib/python3.10/dist-packages/autotrain/trainers/clm.py", line 317, in train
> api.create\_repo(repo\_id=config.repo\_id, repo\_type="model")
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_validators.py", line 118, in \_inner\_fn
> return fn(\*args, \*\*kwargs)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/hf\_api.py", line 2308, in create\_repo
> hf\_raise\_for\_status(r)
> File "/usr/local/lib/python3.10/dist-packages/huggingface\_hub/utils/\_errors.py", line 303, in hf\_raise\_for\_status
> raise HfHubHTTPError(str(e), response=response) from e
> huggingface\_hub.utils.\_errors.HfHubHTTPError: 409 Client Error: Conflict for url: https://huggingface.co/api/repos/create (Request ID: Root=1-64dc9d9e-60d659b1310a77ce2f0ee904;633a51c3-c837-46ba-9cfa-d183cdfde4f9)
> 
> You already created this model repo
> \`\`\`

---

<div class="post-metadata">

**Author:** ![devparagiri](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@devparagiri](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdevparagiri)%5C
**Post date:** [July 8, 2025, 2:56am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fpush-to-hub-cloud-train-not-working%2F161958%2F3 "2025-07-08T02:56:06Z")

</div>

Thank you. Note that I train the slm on their cloud gpu not locally.

Not sure if that might have anything to do. Will try it out!
