Update sections/06_versioning.md
Browse files
sections/06_versioning.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
| 2 |
|
| 3 |
Once you have made a dataset public, create a tagged branch using the [`create_tag`](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_tag) function that allows for including the dataset in reproducible workflows. Versions typically follow standard [semantic versioning guidelines](https://semver.org/) of `<major>.<minor>.<patch>`.
|
| 4 |
|
| 5 |
-
import
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
tag
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
To access the tagged branch from the web-interface, go to the dataset → Files and version → select from the drop-down menu the tagged version:
|
| 13 |
![][image1]
|
| 14 |
To download a specific tagged branch for a dataset, add the `revision="<version>"` argument to `load_dataset()`:
|
| 15 |
|
| 16 |
-
import datasets
|
| 17 |
-
dataset
|
|
|
|
| 2 |
|
| 3 |
Once you have made a dataset public, create a tagged branch using the [`create_tag`](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_tag) function that allows for including the dataset in reproducible workflows. Versions typically follow standard [semantic versioning guidelines](https://semver.org/) of `<major>.<minor>.<patch>`.
|
| 4 |
|
| 5 |
+
import huggingface_hub
|
| 6 |
+
huggingface_hub.create_tag(
|
| 7 |
+
repo_id = "<org_name>/<dataset_name\>",
|
| 8 |
+
tag = "<version>",
|
| 9 |
+
tag_message = "<message>",
|
| 10 |
+
repo_type = "dataset")
|
| 11 |
|
| 12 |
To access the tagged branch from the web-interface, go to the dataset → Files and version → select from the drop-down menu the tagged version:
|
| 13 |
![][image1]
|
| 14 |
To download a specific tagged branch for a dataset, add the `revision="<version>"` argument to `load_dataset()`:
|
| 15 |
|
| 16 |
+
import datasets
|
| 17 |
+
dataset = datasets.load_dataset("<org_name>/<dataset_name>", `revision="1.0"`)
|