Download code/flash/client/specs.py from DavidBShan/flashc-q2-sft: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/datasets/DavidBShan/flashc-q2-sft/resolve/main/code/flash/client/specs.py
- Command line
-
hf download hf://datasets/DavidBShan/flashc-q2-sft/code/flash/client/specs.py
-
curl -L -o specs.py https://huggingface.co/datasets/DavidBShan/flashc-q2-sft/resolve/main/code/flash/client/specs.py
825 Bytes
| """Turn a locally validated JobSpec into the payload sent to the control plane. | |
| The one piece of client-local state a run needs is the pip requirements for installed | |
| verifiers / Prime Hub environments (recorded in ``~/.flash/envs.json`` by | |
| ``slm env install``). The server has no access to that manifest, so the client resolves | |
| it here and ships it inside the spec (``environment.pip``); a value already present in | |
| the config (the documented escape hatch) wins. | |
| """ | |
| from __future__ import annotations | |
| from flash.spec import JobSpec | |
| def spec_payload(spec: JobSpec) -> dict: | |
| out = spec.to_dict() | |
| if not spec.environment.pip: | |
| from flash.envs.registry import worker_pip_for_env | |
| pip = worker_pip_for_env(spec.environment.id) | |
| if pip: | |
| out["environment"]["pip"] = pip | |
| return out | |