Download scripts/inference.py from OneScience-Group/GCRM-ConvectionNN: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/OneScience-Group/GCRM-ConvectionNN/resolve/main/scripts/inference.py
- Command line
-
hf download hf://OneScience-Group/GCRM-ConvectionNN/scripts/inference.py
-
curl -L -o inference.py https://huggingface.co/OneScience-Group/GCRM-ConvectionNN/resolve/main/scripts/inference.py
562 Bytes
| from pathlib import Path | |
| import sys | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from model.gcrm_convectionnn import load_yaml, run_inference | |
| if __name__ == "__main__": | |
| config = load_yaml(ROOT / "conf/config.yaml") | |
| result = run_inference(str(ROOT / config["paths"]["data"]), str(ROOT / config["paths"]["checkpoint"]), | |
| str(ROOT / config["paths"]["predictions"]), config) | |
| print(f"saved inputs={result['inputs'].shape}, predictions={result['prediction'].shape}, lrf={result['lrf_full'].shape}") | |