File size: 442 Bytes
69928d6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""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)