Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
For info, to create tag:
|
2 |
+
|
3 |
+
```python
|
4 |
+
from huggingface_hub import HfApi
|
5 |
+
|
6 |
+
api = HfApi()
|
7 |
+
|
8 |
+
repo_id = "StanfordAIMI/chextemporal"
|
9 |
+
tag_name = "v1.0"
|
10 |
+
|
11 |
+
refs = api.list_repo_refs(repo_id=repo_id, repo_type="dataset")
|
12 |
+
|
13 |
+
main_branch = next((ref for ref in refs.branches if ref.name == "main"), None)
|
14 |
+
|
15 |
+
if main_branch:
|
16 |
+
latest_commit = main_branch.target_commit
|
17 |
+
api.create_tag(
|
18 |
+
repo_id=repo_id,
|
19 |
+
tag=tag_name,
|
20 |
+
revision=latest_commit,
|
21 |
+
repo_type="dataset"
|
22 |
+
)
|
23 |
+
|
24 |
+
print(f"Tag {tag_name} created for commit {latest_commit}")
|
25 |
+
else:
|
26 |
+
print("Main branch not found in the dataset repository.")
|
27 |
+
|
28 |
+
```
|