OnnxBackendConfig#
- class openstef_foundation_models.presets.forecasting_workflow.OnnxBackendConfig(**data: Any) None[source]
Bases:
BaseConfigCompute configuration for an ONNX Runtime inference backend.
Holds only how to run the model (execution providers, session options), not which weights: the checkpoint is supplied to
build()by the caller, so the same compute settings can run different checkpoints.- Parameters:
data (
Any)
- kind: Literal['onnx']
- providers: list[Annotated[CpuProvider | CudaProvider | TensorRTProvider | CoreMLProvider, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] | None
- policy: DefaultProviderPolicy
- session_options: SessionOptionsConfig | None
- build(checkpoint: Annotated[LocalCheckpoint | HubCheckpoint, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]) InferenceBackend[source]
Resolve checkpoint and build the ONNX Runtime backend.
Importing the backend raises
MissingExtraErrorif ONNX Runtime is not installed.- Parameters:
checkpoint (
LocalCheckpoint|HubCheckpoint) – The checkpoint (weights + metadata) to load and run.checkpoint
- Returns:
A ready-to-run backend wrapping the resolved checkpoint.
- Return type:
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].