ts.model_service package¶
Submodules¶
ts.model_service.model_service module¶
ModelService defines an API for base model service.
- class ts.model_service.model_service.ModelService(model_name, model_dir, manifest, gpu=None)[source]¶
Bases:
object
ModelService wraps up all preprocessing, inference and postprocessing functions used by model service. It is defined in a flexible manner to be easily extended to support different frameworks.
- handle(data, context)[source]¶
Backward compatible handle function.
- Parameters:
data –
context –
- Returns:
- abstract inference(data)[source]¶
Wrapper function to run pre-process, inference and post-process functions.
- Parameters:
data (list of object) – Raw input from request.
- Returns:
data to be sent back
- Return type:
list of outputs to be sent back to client.
- initialize(context)[source]¶
Internal initialize ModelService.
- Parameters:
context – MMS context object
- Returns:
- class ts.model_service.model_service.SingleNodeService(model_name, model_dir, manifest, gpu=None)[source]¶
Bases:
ModelService
SingleNodeModel defines abstraction for model service which loads a single model.
Module contents¶
Model services code