Revert mistake convert_dataset_v20_to_v21.py

This commit is contained in:
Remi Cadene 2025-04-17 04:47:00 +02:00
parent eab5543750
commit 54b5c805bf
1 changed files with 10 additions and 10 deletions

View File

@ -59,7 +59,7 @@ def convert_dataset(
num_workers: int = 4,
):
with SuppressWarnings():
dataset = LeRobotDataset(repo_id) #, revision=V20) #, force_cache_sync=True)
dataset = LeRobotDataset(repo_id, revision=V20, force_cache_sync=True)
if (dataset.root / LEGACY_EPISODES_STATS_PATH).is_file():
(dataset.root / LEGACY_EPISODES_STATS_PATH).unlink()
@ -71,21 +71,21 @@ def convert_dataset(
dataset.meta.info["codebase_version"] = CODEBASE_VERSION
write_info(dataset.meta.info, dataset.root)
#dataset.push_to_hub(branch=branch, tag_version=False, allow_patterns="meta/")
dataset.push_to_hub(branch=branch, tag_version=False, allow_patterns="meta/")
# delete old stats.json file
if (dataset.root / STATS_PATH).is_file:
(dataset.root / STATS_PATH).unlink()
# hub_api = HfApi()
# if hub_api.file_exists(
# repo_id=dataset.repo_id, filename=STATS_PATH, revision=branch, repo_type="dataset"
# ):
# hub_api.delete_file(
# path_in_repo=STATS_PATH, repo_id=dataset.repo_id, revision=branch, repo_type="dataset"
# )
hub_api = HfApi()
if hub_api.file_exists(
repo_id=dataset.repo_id, filename=STATS_PATH, revision=branch, repo_type="dataset"
):
hub_api.delete_file(
path_in_repo=STATS_PATH, repo_id=dataset.repo_id, revision=branch, repo_type="dataset"
)
# hub_api.create_tag(repo_id, tag=CODEBASE_VERSION, revision=branch, repo_type="dataset")
hub_api.create_tag(repo_id, tag=CODEBASE_VERSION, revision=branch, repo_type="dataset")
if __name__ == "__main__":