You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pushing to Hugging Face hub branches (revisions) and tags not working #470
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!
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!
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.
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!
Activity
danielhanchen commentedon May 15, 2024
Sorry on the issue! I'll see what I can do!
clrt1 commentedon May 25, 2024
Thank you for looking into this. Also, in a related manner, the
commit_messageandcommit_descriptionthat are passed to theunsloth_push_to_hub_mergedandunsloth_push_to_hub_gguffunctions 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!danielhanchen commentedon May 26, 2024
Oh so sorry this got buried - I'll recheck the issue
shimmyshimmer commentedon Jan 19, 2025
Hopefully the issue is now solved @clrt1 ? Thank you! :)
lone17 commentedon Apr 1, 2025
Hi @shimmyshimmer, I still face the same issue on
2025.3.19. Took a look at the code and it seems like thecommit_messageis still not used forunsloth_push_to_hub_merged.ljvmiranda921 commentedon Nov 5, 2025
Hi! I'm also facing the same issue wrt
revisionnot being used (I passed a value, but is still being uploaded tomain)danielhanchen commentedon Sep 15, 2026
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!