# Tagging (with git tags) models for versioning

**URL:** <https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489>\
**Category:** 🤗Hub\
**Created:** [March 21, 2024, 3:32pm UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489 "2024-03-21T15:32:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![juhoinkinen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/juhoinkinen/32/32436_2.png) [@juhoinkinen](https://discuss.huggingface.co/u/juhoinkinen)\
**Post date:** [March 21, 2024, 3:32pm UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489/1 "2024-03-21T15:32:50Z")

</div>

In the huggingface-hub Python client there are two methods that can be user for (git) tagging:

- [`huggingface_hub.Repository.add_tag()`](https://huggingface.co/docs/huggingface_hub/v0.21.4/en/package_reference/repository#huggingface_hub.Repository.add_tag)
- [`huggingface_hub.HfApi.create_tag ()`](https://huggingface.co/docs/huggingface_hub/v0.21.4/en/package_reference/hf_api#huggingface_hub.HfApi.create_tag)

However, with the [`huggingface-cli`](https://huggingface.co/docs/huggingface_hub/v0.21.4/en/guides/cli) tagging is not possible, and I don’t see a way to create tags in Hugging Face Hub website either. Or am I missing something?

I think it would be possible to create [tags with git](https://git-scm.com/book/en/v2/Git-Basics-Tagging), e.g. `git tag v0.42.0` and then pushing them with `git push --tags`. However, for this the whole repository should be present.

I’ve been working on [integration of a software tool with Hugging Face Hub](https://github.com/NatLibFi/Annif/pull/762), but for simplicity it would be best to leave the tagging functionality out of the implementation if there just was some other way to tag the uploaded models.

Tagging models would be valuable to be able to reference a specific version of the models, because a repository most probably will contain multiple versions of the models.

---

<div class="post-metadata">

**Author:** ![juhoinkinen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/juhoinkinen/32/32436_2.png) [@juhoinkinen](https://discuss.huggingface.co/u/juhoinkinen)\
**Post date:** [March 22, 2024, 6:07am UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489/2 "2024-03-22T06:07:45Z")

</div>

Or is the practice at HF Hub that branches are used for versioning? At least in [LumiOpen/Poro-34B](https://huggingface.co/LumiOpen/Poro-34B/tree/main) this is the case: there are branches for checkpoints 100B-1000B.

---

<div class="post-metadata">

**Author:** ![juhoinkinen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/juhoinkinen/32/32436_2.png) [@juhoinkinen](https://discuss.huggingface.co/u/juhoinkinen)\
**Post date:** [March 22, 2024, 1:27pm UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489/3 "2024-03-22T13:27:55Z")

</div>

An issue for tagging with huggingface-cli was created:

> <https://github.com/huggingface/huggingface_hub/issues/2141>
>
> Requested in https://github.com/huggingface/huggingface\_hub/issues/960#issuecomm…ent-2013533386.
> 
> Similar to https://github.com/huggingface/huggingface\_hub/issues/1655 (branch management from CLI)

---

<div class="post-metadata">

**Author:** ![juhoinkinen](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/juhoinkinen/32/32436_2.png) [@juhoinkinen](https://discuss.huggingface.co/u/juhoinkinen)\
**Post date:** [May 6, 2024, 9:24am UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489/4 "2024-05-06T09:24:52Z")

</div>

Git tagging was implemented in huggingface-CLI in [PR #2172](https://github.com/huggingface/huggingface_hub/pull/2172), released in [v0.23.0](https://github.com/huggingface/huggingface_hub/releases/tag/v0.23.0).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [May 6, 2024, 9:25pm UTC](https://discuss.huggingface.co/t/tagging-with-git-tags-models-for-versioning/78489/5 "2024-05-06T21:25:33Z")

</div>

Closed on May 6, 2024, 9:25pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
