InfectV22's picture
Upload test.py with huggingface_hub
2d3cdc9 verified
Raw History Blame Contribute Delete
981 Bytes
from huggingface_hub import create_repo, upload_folder
import os
datasets_to_push = [
("mon_dataset_manuel_1782511858", "InfectV22/nema_test_session1"),
("mon_dataset_manuel_1782567884", "InfectV22/nema_test_session2"),
("mon_dataset_manuel_1782589342", "InfectV22/nema_test_session3")
]
cache_dir = os.path.expanduser("~/.cache/huggingface/lerobot")
for local_name, remote_repo_id in datasets_to_push:
local_path = os.path.join(cache_dir, local_name)
print(f"======================================")
print(f"Uploading {local_name} -> {remote_repo_id}")
print(f"======================================")
# Cree le repertoire distant s'il n'existe pas
create_repo(remote_repo_id, repo_type="dataset", exist_ok=True)
# Upload tout le contenu
upload_folder(
folder_path=local_path,
repo_id=remote_repo_id,
repo_type="dataset"
)
print("Done!\n")
print("All datasets uploaded successfully!")