Download src/softasp/inference.py from wabdalm/AS2: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/wabdalm/AS2/resolve/main/src/softasp/inference.py
- Command line
-
hf download hf://wabdalm/AS2/src/softasp/inference.py
-
curl -L -o inference.py https://huggingface.co/wabdalm/AS2/resolve/main/src/softasp/inference.py
442 Bytes
| """Configuration-driven AS2 inference API.""" | |
| from omegaconf import DictConfig | |
| from softasp.instantiations.runtime import predict, provider | |
| def load_model(cfg: DictConfig): | |
| """Load a checkpoint according to the selected model provider.""" | |
| return provider(cfg, "model").load(cfg) | |
| def predict_file(cfg: DictConfig) -> dict: | |
| """Read and predict according to the explicit instantiation configuration.""" | |
| return predict(cfg) | |