| """Bootstrap a Kaggle dataset copy of brain_server into /kaggle/working and print run guidance.""" |
| from __future__ import annotations |
|
|
| import os |
| import shutil |
| from pathlib import Path |
|
|
|
|
| def main() -> None: |
| source_root = Path(__file__).resolve().parent |
| runtime_root = Path(os.getenv("KAPO_RUNTIME_ROOT") or "/kaggle/working/brain_server").resolve() |
|
|
| if source_root != runtime_root: |
| if runtime_root.exists(): |
| shutil.rmtree(runtime_root, ignore_errors=True) |
| shutil.copytree(source_root, runtime_root) |
|
|
| print(f"Bootstrapped brain_server to: {runtime_root}") |
| print("Next steps:") |
| print(f" %cd {runtime_root}") |
| print(" !pip install --default-timeout=1000 --no-cache-dir -r requirements.txt") |
| print(" !python -m uvicorn api.main:app --host 0.0.0.0 --port 7860") |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|