Download src/softasp/cli/predict.py from wabdalm/AS2: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/wabdalm/AS2/resolve/main/src/softasp/cli/predict.py
- Command line
-
hf download hf://wabdalm/AS2/src/softasp/cli/predict.py
-
curl -L -o predict.py https://huggingface.co/wabdalm/AS2/resolve/main/src/softasp/cli/predict.py
726 Bytes
| """Predict using the selected AS2 instantiation's input/output contract.""" | |
| import json | |
| from pathlib import Path | |
| import hydra | |
| from omegaconf import DictConfig | |
| from softasp.configuration import config_directory | |
| from softasp.instantiations.runtime import predict | |
| def main(cfg: DictConfig) -> None: | |
| result = predict(cfg) | |
| destination = Path(cfg.output) | |
| destination.parent.mkdir(parents=True, exist_ok=True) | |
| with destination.open("x") as stream: | |
| json.dump(result, stream, indent=2, allow_nan=False) | |
| stream.write("\n") | |
| print(f"Predictions saved to {destination}") | |
| if __name__ == "__main__": | |
| main() | |