| set -euo pipefail | |
| ROOT="/mnt/t2-6tb/Linpeikai/BiPTV3_CVPR/code/pointcept_framework" | |
| python3 - <<'PY' | |
| from pathlib import Path | |
| defaults = Path("/mnt/t2-6tb/Linpeikai/BiPTV3_CVPR/code/pointcept_framework/pointcept/datasets/defaults.py") | |
| text = defaults.read_text() | |
| old = """ ignore_index=-1, | |
| loop=1, | |
| ): | |
| """ | |
| new = """ ignore_index=-1, | |
| loop=1, | |
| **kwargs, | |
| ): | |
| """ | |
| if old in text and "**kwargs" not in text: | |
| defaults.write_text(text.replace(old, new, 1)) | |
| print(f"patched {defaults}") | |
| else: | |
| print(f"skip {defaults}") | |
| wc1 = Path("/mnt/t2-6tb/Linpeikai/BiPTV3_CVPR/code/pointcept_framework/tools/test_wc1.py") | |
| text = wc1.read_text() | |
| text = text.replace("WC_1", "office_9") | |
| wc1.write_text(text) | |
| print(f"patched {wc1}") | |
| PY | |
| echo "Patch complete." | |