File size: 620 Bytes
c625b65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
For info, to create tag:

```python
from huggingface_hub import HfApi

api = HfApi()

repo_id = "StanfordAIMI/chextemporal"
tag_name = "v1.0"

refs = api.list_repo_refs(repo_id=repo_id, repo_type="dataset")

main_branch = next((ref for ref in refs.branches if ref.name == "main"), None)

if main_branch:
    latest_commit = main_branch.target_commit
    api.create_tag(
        repo_id=repo_id,
        tag=tag_name,
        revision=latest_commit,
        repo_type="dataset"
    )

    print(f"Tag {tag_name} created for commit {latest_commit}")
else:
    print("Main branch not found in the dataset repository.")

```