orkgnlp.common.service.runners.ORKGNLPONNXRunner
- class ORKGNLPONNXRunner(*args)[source]
Bases:
ORKGNLPBaseRunnerThe ORKGNLPONNXRunner is a runner specialized for ONNX model formats. It requires therefore a model object of type
onnx.- Parameters:
model (Model object. See the inheriting classes for further information.) – The model to be run.
Methods
Releases the memory of all available attributes in a pipeline component.
Runs the given model while initiation in evaluation mode and returns its output.
- release_memory()
Releases the memory of all available attributes in a pipeline component.
- run(inputs, output_names=None, custom_input_dict=None, **kwargs)[source]
Runs the given model while initiation in evaluation mode and returns its output.
- Parameters:
inputs (
Tuple[Any]) – Tuple of model arguments.output_names (
List[str]) – List of output names of the ONNX graph. Check your exporting code for further information! Defaults to None.custom_input_dict (Dict[str, List[Any]].) – When given, the argument
inputswill be ignored. This argument must have the following schema: {input_name_0: [input_value_0], …, input_name_n: [input_value_n]}. Check your exporting code for further information! Defaults to None.
- Return type:
Tuple[Any,Dict[str,Any]]- Returns:
The model output and kwargs.