Skip to content

Pushing to Hugging Face hub branches (revisions) and tags not working #470

Closed

Description

@clrt1

When using the fine-tuned model's push_to_hub_merged and push_to_hub_gguf functions, the specified revision is not used and things are instead pushed to the default active branch.

Looking through the save.py code, 'd say you need to modify the upload_to_huggingface function by adding "revision" and "tags" arguments and use those in the push_to_hub and upload_file functions enclosed therein. Maybe do similarly in other places as needed.

Would be very thankful for a fix or tips if I got something wrong.
Many thanks for your work and great framework!

Activity

  1. danielhanchen commented on May 15, 2024

    @danielhanchen
    Member

    Sorry on the issue! I'll see what I can do!

  2. clrt1 commented on May 25, 2024

    @clrt1
    Author

    Thank you for looking into this. Also, in a related manner, the commit_messageand commit_description that are passed to the unsloth_push_to_hub_merged and unsloth_push_to_hub_gguf functions are not used. A push to Hugging Face only shows up with the commit message "(Trained with Unsloth)" even though a specific message was passed. I think this should be easy to fix (see my opening issue message). Many thanks in advance!

  3. danielhanchen commented on May 26, 2024

    @danielhanchen
    Member

    Oh so sorry this got buried - I'll recheck the issue

  4. shimmyshimmer commented on Jan 19, 2025

    @shimmyshimmer
    Member

    Hopefully the issue is now solved @clrt1 ? Thank you! :)

  5. lone17 commented on Apr 1, 2025

    @lone17

    Hopefully the issue is now solved @clrt1 ? Thank you! :)

    Hi @shimmyshimmer, I still face the same issue on 2025.3.19. Took a look at the code and it seems like the commit_message is still not used for unsloth_push_to_hub_merged.

  6. ljvmiranda921 commented on Nov 5, 2025

    @ljvmiranda921

    Hi! I'm also facing the same issue wrt revision not being used (I passed a value, but is still being uploaded to main)

  7. danielhanchen commented on Sep 15, 2026

    @danielhanchen
    Member

    This works now! I pushed with push_to_hub_merged passing a revision, a commit message and tags, and everything landed on the branch, main was untouched, the commit title was exactly what I passed and the tag showed up on the model. If you still see the push go to main on the latest version, reopen with the exact call you used and I'll take another look!

    Please update Unsloth: uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir (if it's not in the current release yet it'll be in the next one). Reopen if it still happens!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    currently fixing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions