| |
| """Update every repo's README *and* the helper scripts in one run. |
| |
| Korean README <- WORKFLOW.md -> JSHNSL/humanoid-imitation-learning (model) |
| English README <- WORKFLOW_en.md -> JSHNSL/humanoid-imitation-learning-en (model) |
| HDF5 hub README <- HDF5_HUB_README.md -> JSHNSL/ffw_sg2_hdf5 (dataset) |
| Scripts (push_dataset.py, push_hdf5.py, hpo_optuna.py, ...) -> Korean repo root |
| |
| Whenever you edit a WORKFLOW/README or a script, run: |
| lerobot-python sync_docs.py |
| |
| Note: recent huggingface_hub versions accept keyword arguments only. |
| """ |
| import os |
|
|
| from huggingface_hub import create_repo, upload_file |
|
|
| KO = "JSHNSL/humanoid-imitation-learning" |
| EN = "JSHNSL/humanoid-imitation-learning-en" |
| HDF5_HUB = "JSHNSL/ffw_sg2_hdf5" |
|
|
| |
| SCRIPTS = [ |
| "push_dataset.py", |
| "push_hdf5.py", |
| "merge_hdf5_demos.py", |
| "hpo_optuna.py", |
| "hpo_train_shim.py", |
| "sync_docs.py", |
| ] |
|
|
| |
| DOCS = [ |
| ("WORKFLOW.md", "README.md", KO, "model"), |
| ("WORKFLOW.md", "WORKFLOW.md", KO, "model"), |
| ("WORKFLOW_en.md", "README.md", EN, "model"), |
| ("WORKFLOW_en.md", "WORKFLOW_en.md", EN, "model"), |
| ("HDF5_HUB_README.md", "README.md", HDF5_HUB, "dataset"), |
| |
| ("SETUP_CYCLO_GROOT.md", "SETUP_CYCLO_GROOT.md", KO, "model"), |
| ("GROOT_FINETUNE.md", "GROOT_FINETUNE.md", KO, "model"), |
| ("WRIST_CAM.md", "WRIST_CAM.md", KO, "model"), |
| ] |
|
|
|
|
| def push(local: str, dest: str, repo_id: str, repo_type: str = "model") -> None: |
| upload_file( |
| path_or_fileobj=local, |
| path_in_repo=dest, |
| repo_id=repo_id, |
| repo_type=repo_type, |
| ) |
|
|
|
|
| |
| create_repo(repo_id=HDF5_HUB, repo_type="dataset", exist_ok=True) |
|
|
| print("Docs:") |
| for local, dest, repo, rtype in DOCS: |
| if not os.path.exists(local): |
| print(f" skip (not found): {local}") |
| continue |
| push(local, dest, repo, rtype) |
| print(f" {local} -> {repo}:{dest} [{rtype}]") |
|
|
| print("\nScripts:") |
| for s in SCRIPTS: |
| if not os.path.exists(s): |
| print(f" skip (not found): {s}") |
| continue |
| push(s, s, KO, "model") |
| print(f" {s} -> {KO}:{s}") |
|
|
| print("\nDone:") |
| print(" KO ->", "https://huggingface.co/" + KO) |
| print(" EN ->", "https://huggingface.co/" + EN) |
| print(" HDF5 hub ->", "https://huggingface.co/datasets/" + HDF5_HUB) |
|
|