|
58 | 58 | "hf_run_id": "policy_spatial_v1", |
59 | 59 | "hf_token_env": "HF_TOKEN", |
60 | 60 | "hf_local_dir": "hf_checkpoints", |
| 61 | + "max_pending_hf_uploads": 2, |
| 62 | + "hf_upload_future_timeout_s": 120.0, |
61 | 63 | "show_progress_bar": False, |
62 | 64 | "trainer_log_every_n_steps": 99_999, |
63 | 65 | "monitor_log_every": 5, |
@@ -170,6 +172,8 @@ def parse_args() -> argparse.Namespace: |
170 | 172 | parser.add_argument("--hf", action="store_true") |
171 | 173 | parser.add_argument("--hf-repo-id", default=None) |
172 | 174 | parser.add_argument("--hf-run-id", default=None) |
| 175 | + parser.add_argument("--max-pending-hf-uploads", type=int, default=None) |
| 176 | + parser.add_argument("--hf-upload-timeout-s", type=float, default=None) |
173 | 177 | return parser.parse_args() |
174 | 178 |
|
175 | 179 |
|
@@ -285,6 +289,10 @@ def apply_cli_overrides(args: argparse.Namespace) -> None: |
285 | 289 | CONFIG["hf_repo_id"] = args.hf_repo_id |
286 | 290 | if args.hf_run_id is not None: |
287 | 291 | CONFIG["hf_run_id"] = args.hf_run_id.strip() |
| 292 | + if args.max_pending_hf_uploads is not None: |
| 293 | + CONFIG["max_pending_hf_uploads"] = max(1, args.max_pending_hf_uploads) |
| 294 | + if args.hf_upload_timeout_s is not None: |
| 295 | + CONFIG["hf_upload_future_timeout_s"] = max(1.0, args.hf_upload_timeout_s) |
288 | 296 |
|
289 | 297 |
|
290 | 298 | def cfg_int(key: str) -> int: |
@@ -344,6 +352,10 @@ def validate_config() -> None: |
344 | 352 | raise ValueError("CONFIG['mcts_cache_size'] must be >= 0.") |
345 | 353 | if cfg_int("ddp_timeout_seconds") <= 0: |
346 | 354 | raise ValueError("CONFIG['ddp_timeout_seconds'] must be > 0.") |
| 355 | + if cfg_int("max_pending_hf_uploads") <= 0: |
| 356 | + raise ValueError("CONFIG['max_pending_hf_uploads'] must be > 0.") |
| 357 | + if cfg_float("hf_upload_future_timeout_s") <= 0.0: |
| 358 | + raise ValueError("CONFIG['hf_upload_future_timeout_s'] must be > 0.") |
347 | 359 |
|
348 | 360 | opp_sum = ( |
349 | 361 | cfg_float("opponent_self_prob") |
|
0 commit comments