Download runtime/deployment_versions.py from BAAI/PingPongRealWorldRL: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/BAAI/PingPongRealWorldRL/resolve/main/runtime/deployment_versions.py
- Command line
-
hf download hf://BAAI/PingPongRealWorldRL/runtime/deployment_versions.py
-
curl -L -o deployment_versions.py https://huggingface.co/BAAI/PingPongRealWorldRL/resolve/main/runtime/deployment_versions.py
1.73 kB
| """One selection binds the adapter, predictor and policy for real and sim runs.""" | |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| class DeploymentBundle: | |
| velocity: str | |
| predictor: str | |
| policy_key: str | |
| notice_policy: str = "stage-b" | |
| generation_trigger_tth_s: float | None = None | |
| def policy_path(self) -> Path: | |
| return PROJECT_ROOT / self.policy_key | |
| DEPLOYMENTS = { | |
| "original": DeploymentBundle("original", "original", "policies/h2/h2_stageC_model_10500.onnx"), | |
| "v1": DeploymentBundle("physics-ls-v1", "rk4-v1", "policies/h2/h2_real_v1_model_8998.onnx", "curriculum", 0.55), | |
| "v2": DeploymentBundle("physics-ls-v2", "rk4-v2", "policies/h2/h2_tail_v2_model_9997.onnx", "curriculum", 0.55), | |
| } | |
| def deployment_bundle(version: str) -> DeploymentBundle: | |
| try: | |
| return DEPLOYMENTS[version] | |
| except KeyError: | |
| raise ValueError(f"unknown deployment version: {version!r}; choose original|v1|v2") from None | |
| if __name__ == "__main__": | |
| import argparse | |
| import shlex | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("version", choices=DEPLOYMENTS) | |
| args = parser.parse_args() | |
| bundle = deployment_bundle(args.version) | |
| # Only fixed local values are emitted; launchers evaluate these assignments. | |
| for name, value in { | |
| "H2_DEPLOYMENT_VERSION": args.version, | |
| "H2_VELOCITY_VERSION": bundle.velocity, | |
| "H2_PREDICTOR_VERSION": bundle.predictor, | |
| "H2_POLICY_PATH": str(bundle.policy_path), | |
| "H2_NOTICE_POLICY": bundle.notice_policy, | |
| }.items(): | |
| print(f"{name}={shlex.quote(value)}") | |