pixano_inference.models.base
Shared base class for deployed inference models.
InferenceModel(config)
Bases: ABC
Abstract base class for all inference models deployed on Ray Serve.
Subclass this to implement custom inference models that can be deployed on Ray Serve.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
ModelDeploymentConfig
|
Model deployment configuration. |
required |
Source code in pixano_inference/models/base.py
capability
property
Capability handled by this model.
config
property
Model deployment configuration.
metadata
property
Model metadata. Override for custom metadata.
model_name
property
Unique model name.
load_model()
abstractmethod
Load model artifacts.
Called once in the Ray actor __init__. Implement this to load
weights, initialize processors, etc.
predict(input)
abstractmethod
Run inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
BaseModel
|
Task-specific Input object (subclasses narrow this type). |
required |
Returns:
| Type | Description |
|---|---|
BaseModel
|
Task-specific Output object (subclasses narrow this type). |