code
stringlengths
66
870k
docstring
stringlengths
19
26.7k
func_name
stringlengths
1
138
language
stringclasses
1 value
repo
stringlengths
7
68
path
stringlengths
5
324
url
stringlengths
46
389
license
stringclasses
7 values
def local_models(self, local_models): """Sets the local_models of this V1alpha1LocalModelNodeSpec. List of model source URI and their names # noqa: E501 :param local_models: The local_models of this V1alpha1LocalModelNodeSpec. # noqa: E501 :type: list[V1alpha1LocalModelInfo] ...
Sets the local_models of this V1alpha1LocalModelNodeSpec. List of model source URI and their names # noqa: E501 :param local_models: The local_models of this V1alpha1LocalModelNodeSpec. # noqa: E501 :type: list[V1alpha1LocalModelInfo]
local_models
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_local_model_node_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_local_model_node_spec.py
Apache-2.0
def framework(self, framework): """Sets the framework of this V1alpha1ModelSpec. Machine Learning <framework name> The values could be: \"tensorflow\",\"pytorch\",\"sklearn\",\"onnx\",\"xgboost\", \"myawesomeinternalframework\" etc. # noqa: E501 :param framework: The framework of this V1alpha...
Sets the framework of this V1alpha1ModelSpec. Machine Learning <framework name> The values could be: "tensorflow","pytorch","sklearn","onnx","xgboost", "myawesomeinternalframework" etc. # noqa: E501 :param framework: The framework of this V1alpha1ModelSpec. # noqa: E501 :type: str
framework
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_model_spec.py
Apache-2.0
def memory(self, memory): """Sets the memory of this V1alpha1ModelSpec. :param memory: The memory of this V1alpha1ModelSpec. # noqa: E501 :type: ResourceQuantity """ if self.local_vars_configuration.client_side_validation and memory is None: # noqa: E501 raise Val...
Sets the memory of this V1alpha1ModelSpec. :param memory: The memory of this V1alpha1ModelSpec. # noqa: E501 :type: ResourceQuantity
memory
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_model_spec.py
Apache-2.0
def storage_uri(self, storage_uri): """Sets the storage_uri of this V1alpha1ModelSpec. Storage URI for the model repository # noqa: E501 :param storage_uri: The storage_uri of this V1alpha1ModelSpec. # noqa: E501 :type: str """ if self.local_vars_configuration.client_...
Sets the storage_uri of this V1alpha1ModelSpec. Storage URI for the model repository # noqa: E501 :param storage_uri: The storage_uri of this V1alpha1ModelSpec. # noqa: E501 :type: str
storage_uri
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_model_spec.py
Apache-2.0
def items(self, items): """Sets the items of this V1alpha1ServingRuntimeList. :param items: The items of this V1alpha1ServingRuntimeList. # noqa: E501 :type: list[V1alpha1ServingRuntime] """ if self.local_vars_configuration.client_side_validation and items is None: # noqa: E5...
Sets the items of this V1alpha1ServingRuntimeList. :param items: The items of this V1alpha1ServingRuntimeList. # noqa: E501 :type: list[V1alpha1ServingRuntime]
items
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_serving_runtime_list.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_serving_runtime_list.py
Apache-2.0
def containers(self, containers): """Sets the containers of this V1alpha1ServingRuntimePodSpec. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The conta...
Sets the containers of this V1alpha1ServingRuntimePodSpec. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers of this V1alpha1ServingRuntimePodSpec. ...
containers
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_serving_runtime_pod_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_serving_runtime_pod_spec.py
Apache-2.0
def containers(self, containers): """Sets the containers of this V1alpha1ServingRuntimeSpec. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containe...
Sets the containers of this V1alpha1ServingRuntimeSpec. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers of this V1alpha1ServingRuntimeSpec. # noq...
containers
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_serving_runtime_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_serving_runtime_spec.py
Apache-2.0
def container(self, container): """Sets the container of this V1alpha1StorageContainerSpec. :param container: The container of this V1alpha1StorageContainerSpec. # noqa: E501 :type: V1Container """ if self.local_vars_configuration.client_side_validation and container is None: ...
Sets the container of this V1alpha1StorageContainerSpec. :param container: The container of this V1alpha1StorageContainerSpec. # noqa: E501 :type: V1Container
container
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_storage_container_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_storage_container_spec.py
Apache-2.0
def supported_uri_formats(self, supported_uri_formats): """Sets the supported_uri_formats of this V1alpha1StorageContainerSpec. List of URI formats that this container supports # noqa: E501 :param supported_uri_formats: The supported_uri_formats of this V1alpha1StorageContainerSpec. # noqa: ...
Sets the supported_uri_formats of this V1alpha1StorageContainerSpec. List of URI formats that this container supports # noqa: E501 :param supported_uri_formats: The supported_uri_formats of this V1alpha1StorageContainerSpec. # noqa: E501 :type: list[V1alpha1SupportedUriFormat]
supported_uri_formats
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_storage_container_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_storage_container_spec.py
Apache-2.0
def items(self, items): """Sets the items of this V1alpha1TrainedModelList. :param items: The items of this V1alpha1TrainedModelList. # noqa: E501 :type: list[V1alpha1TrainedModel] """ if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 ...
Sets the items of this V1alpha1TrainedModelList. :param items: The items of this V1alpha1TrainedModelList. # noqa: E501 :type: list[V1alpha1TrainedModel]
items
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_trained_model_list.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_trained_model_list.py
Apache-2.0
def inference_service(self, inference_service): """Sets the inference_service of this V1alpha1TrainedModelSpec. parent inference service to deploy to # noqa: E501 :param inference_service: The inference_service of this V1alpha1TrainedModelSpec. # noqa: E501 :type: str """ ...
Sets the inference_service of this V1alpha1TrainedModelSpec. parent inference service to deploy to # noqa: E501 :param inference_service: The inference_service of this V1alpha1TrainedModelSpec. # noqa: E501 :type: str
inference_service
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_trained_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_trained_model_spec.py
Apache-2.0
def model(self, model): """Sets the model of this V1alpha1TrainedModelSpec. :param model: The model of this V1alpha1TrainedModelSpec. # noqa: E501 :type: V1alpha1ModelSpec """ if self.local_vars_configuration.client_side_validation and model is None: # noqa: E501 ...
Sets the model of this V1alpha1TrainedModelSpec. :param model: The model of this V1alpha1TrainedModelSpec. # noqa: E501 :type: V1alpha1ModelSpec
model
python
kserve/kserve
python/kserve/kserve/models/v1alpha1_trained_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1alpha1_trained_model_spec.py
Apache-2.0
def name(self, name): """Sets the name of this V1beta1ARTExplainerSpec. Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. # noqa: E501 :param name: The name of this V1beta1ARTExplainerSpec. # noqa: E501 :ty...
Sets the name of this V1beta1ARTExplainerSpec. Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. # noqa: E501 :param name: The name of this V1beta1ARTExplainerSpec. # noqa: E501 :type: str
name
python
kserve/kserve
python/kserve/kserve/models/v1beta1_art_explainer_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_art_explainer_spec.py
Apache-2.0
def type(self, type): """Sets the type of this V1beta1ARTExplainerSpec. The type of ART explainer # noqa: E501 :param type: The type of this V1beta1ARTExplainerSpec. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and type is None: ...
Sets the type of this V1beta1ARTExplainerSpec. The type of ART explainer # noqa: E501 :param type: The type of this V1beta1ARTExplainerSpec. # noqa: E501 :type: str
type
python
kserve/kserve
python/kserve/kserve/models/v1beta1_art_explainer_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_art_explainer_spec.py
Apache-2.0
def containers(self, containers): """Sets the containers of this V1beta1CustomExplainer. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers o...
Sets the containers of this V1beta1CustomExplainer. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers of this V1beta1CustomExplainer. # noqa: E501 ...
containers
python
kserve/kserve
python/kserve/kserve/models/v1beta1_custom_explainer.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_custom_explainer.py
Apache-2.0
def containers(self, containers): """Sets the containers of this V1beta1CustomPredictor. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers o...
Sets the containers of this V1beta1CustomPredictor. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers of this V1beta1CustomPredictor. # noqa: E501 ...
containers
python
kserve/kserve
python/kserve/kserve/models/v1beta1_custom_predictor.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_custom_predictor.py
Apache-2.0
def containers(self, containers): """Sets the containers of this V1beta1CustomTransformer. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers...
Sets the containers of this V1beta1CustomTransformer. List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. # noqa: E501 :param containers: The containers of this V1beta1CustomTransformer. # noqa: E...
containers
python
kserve/kserve
python/kserve/kserve/models/v1beta1_custom_transformer.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_custom_transformer.py
Apache-2.0
def default_image_version(self, default_image_version): """Sets the default_image_version of this V1beta1ExplainerConfig. default explainer docker image version # noqa: E501 :param default_image_version: The default_image_version of this V1beta1ExplainerConfig. # noqa: E501 :type: st...
Sets the default_image_version of this V1beta1ExplainerConfig. default explainer docker image version # noqa: E501 :param default_image_version: The default_image_version of this V1beta1ExplainerConfig. # noqa: E501 :type: str
default_image_version
python
kserve/kserve
python/kserve/kserve/models/v1beta1_explainer_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_explainer_config.py
Apache-2.0
def image(self, image): """Sets the image of this V1beta1ExplainerConfig. explainer docker image name # noqa: E501 :param image: The image of this V1beta1ExplainerConfig. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and image is ...
Sets the image of this V1beta1ExplainerConfig. explainer docker image name # noqa: E501 :param image: The image of this V1beta1ExplainerConfig. # noqa: E501 :type: str
image
python
kserve/kserve
python/kserve/kserve/models/v1beta1_explainer_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_explainer_config.py
Apache-2.0
def metric(self, metric): """Sets the metric of this V1beta1ExternalMetricSource. :param metric: The metric of this V1beta1ExternalMetricSource. # noqa: E501 :type: V1beta1ExternalMetrics """ if self.local_vars_configuration.client_side_validation and metric is None: # noqa: ...
Sets the metric of this V1beta1ExternalMetricSource. :param metric: The metric of this V1beta1ExternalMetricSource. # noqa: E501 :type: V1beta1ExternalMetrics
metric
python
kserve/kserve
python/kserve/kserve/models/v1beta1_external_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_external_metric_source.py
Apache-2.0
def target(self, target): """Sets the target of this V1beta1ExternalMetricSource. :param target: The target of this V1beta1ExternalMetricSource. # noqa: E501 :type: V1beta1MetricTarget """ if self.local_vars_configuration.client_side_validation and target is None: # noqa: E50...
Sets the target of this V1beta1ExternalMetricSource. :param target: The target of this V1beta1ExternalMetricSource. # noqa: E501 :type: V1beta1MetricTarget
target
python
kserve/kserve
python/kserve/kserve/models/v1beta1_external_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_external_metric_source.py
Apache-2.0
def explainers(self, explainers): """Sets the explainers of this V1beta1InferenceServicesConfig. :param explainers: The explainers of this V1beta1InferenceServicesConfig. # noqa: E501 :type: V1beta1ExplainersConfig """ if self.local_vars_configuration.client_side_validation an...
Sets the explainers of this V1beta1InferenceServicesConfig. :param explainers: The explainers of this V1beta1InferenceServicesConfig. # noqa: E501 :type: V1beta1ExplainersConfig
explainers
python
kserve/kserve
python/kserve/kserve/models/v1beta1_inference_services_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_inference_services_config.py
Apache-2.0
def items(self, items): """Sets the items of this V1beta1InferenceServiceList. :param items: The items of this V1beta1InferenceServiceList. # noqa: E501 :type: list[V1beta1InferenceService] """ if self.local_vars_configuration.client_side_validation and items is None: # noqa:...
Sets the items of this V1beta1InferenceServiceList. :param items: The items of this V1beta1InferenceServiceList. # noqa: E501 :type: list[V1beta1InferenceService]
items
python
kserve/kserve
python/kserve/kserve/models/v1beta1_inference_service_list.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_inference_service_list.py
Apache-2.0
def predictor(self, predictor): """Sets the predictor of this V1beta1InferenceServiceSpec. :param predictor: The predictor of this V1beta1InferenceServiceSpec. # noqa: E501 :type: V1beta1PredictorSpec """ if self.local_vars_configuration.client_side_validation and predictor is...
Sets the predictor of this V1beta1InferenceServiceSpec. :param predictor: The predictor of this V1beta1InferenceServiceSpec. # noqa: E501 :type: V1beta1PredictorSpec
predictor
python
kserve/kserve
python/kserve/kserve/models/v1beta1_inference_service_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_inference_service_spec.py
Apache-2.0
def enabled(self, enabled): """Sets the enabled of this V1beta1LocalModelConfig. :param enabled: The enabled of this V1beta1LocalModelConfig. # noqa: E501 :type: bool """ if self.local_vars_configuration.client_side_validation and enabled is None: # noqa: E501 rai...
Sets the enabled of this V1beta1LocalModelConfig. :param enabled: The enabled of this V1beta1LocalModelConfig. # noqa: E501 :type: bool
enabled
python
kserve/kserve
python/kserve/kserve/models/v1beta1_local_model_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_local_model_config.py
Apache-2.0
def job_namespace(self, job_namespace): """Sets the job_namespace of this V1beta1LocalModelConfig. :param job_namespace: The job_namespace of this V1beta1LocalModelConfig. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and job_namespace is ...
Sets the job_namespace of this V1beta1LocalModelConfig. :param job_namespace: The job_namespace of this V1beta1LocalModelConfig. # noqa: E501 :type: str
job_namespace
python
kserve/kserve
python/kserve/kserve/models/v1beta1_local_model_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_local_model_config.py
Apache-2.0
def type(self, type): """Sets the type of this V1beta1MetricsSpec. type is the type of metric source. It should be one of \"Resource\", \"External\", \"PodMetric\". \"Resource\" or \"External\" each mapping to a matching field in the object. # noqa: E501 :param type: The type of this V1beta1...
Sets the type of this V1beta1MetricsSpec. type is the type of metric source. It should be one of "Resource", "External", "PodMetric". "Resource" or "External" each mapping to a matching field in the object. # noqa: E501 :param type: The type of this V1beta1MetricsSpec. # noqa: E501 :type: s...
type
python
kserve/kserve
python/kserve/kserve/models/v1beta1_metrics_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_metrics_spec.py
Apache-2.0
def failed_copies(self, failed_copies): """Sets the failed_copies of this V1beta1ModelCopies. How many copies of this predictor's models failed to load recently # noqa: E501 :param failed_copies: The failed_copies of this V1beta1ModelCopies. # noqa: E501 :type: int """ ...
Sets the failed_copies of this V1beta1ModelCopies. How many copies of this predictor's models failed to load recently # noqa: E501 :param failed_copies: The failed_copies of this V1beta1ModelCopies. # noqa: E501 :type: int
failed_copies
python
kserve/kserve
python/kserve/kserve/models/v1beta1_model_copies.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_model_copies.py
Apache-2.0
def active_model_state(self, active_model_state): """Sets the active_model_state of this V1beta1ModelRevisionStates. High level state string: Pending, Standby, Loading, Loaded, FailedToLoad # noqa: E501 :param active_model_state: The active_model_state of this V1beta1ModelRevisionStates. # n...
Sets the active_model_state of this V1beta1ModelRevisionStates. High level state string: Pending, Standby, Loading, Loaded, FailedToLoad # noqa: E501 :param active_model_state: The active_model_state of this V1beta1ModelRevisionStates. # noqa: E501 :type: str
active_model_state
python
kserve/kserve
python/kserve/kserve/models/v1beta1_model_revision_states.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_model_revision_states.py
Apache-2.0
def model_format(self, model_format): """Sets the model_format of this V1beta1ModelSpec. :param model_format: The model_format of this V1beta1ModelSpec. # noqa: E501 :type: V1beta1ModelFormat """ if self.local_vars_configuration.client_side_validation and model_format is None:...
Sets the model_format of this V1beta1ModelSpec. :param model_format: The model_format of this V1beta1ModelSpec. # noqa: E501 :type: V1beta1ModelFormat
model_format
python
kserve/kserve
python/kserve/kserve/models/v1beta1_model_spec.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_model_spec.py
Apache-2.0
def transition_status(self, transition_status): """Sets the transition_status of this V1beta1ModelStatus. Whether the available predictor endpoints reflect the current Spec or is in transition # noqa: E501 :param transition_status: The transition_status of this V1beta1ModelStatus. # noqa: E5...
Sets the transition_status of this V1beta1ModelStatus. Whether the available predictor endpoints reflect the current Spec or is in transition # noqa: E501 :param transition_status: The transition_status of this V1beta1ModelStatus. # noqa: E501 :type: str
transition_status
python
kserve/kserve
python/kserve/kserve/models/v1beta1_model_status.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_model_status.py
Apache-2.0
def metric(self, metric): """Sets the metric of this V1beta1PodMetricSource. :param metric: The metric of this V1beta1PodMetricSource. # noqa: E501 :type: V1beta1PodMetrics """ if self.local_vars_configuration.client_side_validation and metric is None: # noqa: E501 ...
Sets the metric of this V1beta1PodMetricSource. :param metric: The metric of this V1beta1PodMetricSource. # noqa: E501 :type: V1beta1PodMetrics
metric
python
kserve/kserve
python/kserve/kserve/models/v1beta1_pod_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_pod_metric_source.py
Apache-2.0
def target(self, target): """Sets the target of this V1beta1PodMetricSource. :param target: The target of this V1beta1PodMetricSource. # noqa: E501 :type: V1beta1MetricTarget """ if self.local_vars_configuration.client_side_validation and target is None: # noqa: E501 ...
Sets the target of this V1beta1PodMetricSource. :param target: The target of this V1beta1PodMetricSource. # noqa: E501 :type: V1beta1MetricTarget
target
python
kserve/kserve
python/kserve/kserve/models/v1beta1_pod_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_pod_metric_source.py
Apache-2.0
def default_gpu_image_version(self, default_gpu_image_version): """Sets the default_gpu_image_version of this V1beta1PredictorConfig. default predictor docker image version on gpu # noqa: E501 :param default_gpu_image_version: The default_gpu_image_version of this V1beta1PredictorConfig. # n...
Sets the default_gpu_image_version of this V1beta1PredictorConfig. default predictor docker image version on gpu # noqa: E501 :param default_gpu_image_version: The default_gpu_image_version of this V1beta1PredictorConfig. # noqa: E501 :type: str
default_gpu_image_version
python
kserve/kserve
python/kserve/kserve/models/v1beta1_predictor_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_predictor_config.py
Apache-2.0
def default_image_version(self, default_image_version): """Sets the default_image_version of this V1beta1PredictorConfig. default predictor docker image version on cpu # noqa: E501 :param default_image_version: The default_image_version of this V1beta1PredictorConfig. # noqa: E501 :t...
Sets the default_image_version of this V1beta1PredictorConfig. default predictor docker image version on cpu # noqa: E501 :param default_image_version: The default_image_version of this V1beta1PredictorConfig. # noqa: E501 :type: str
default_image_version
python
kserve/kserve
python/kserve/kserve/models/v1beta1_predictor_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_predictor_config.py
Apache-2.0
def image(self, image): """Sets the image of this V1beta1PredictorConfig. predictor docker image name # noqa: E501 :param image: The image of this V1beta1PredictorConfig. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and image is ...
Sets the image of this V1beta1PredictorConfig. predictor docker image name # noqa: E501 :param image: The image of this V1beta1PredictorConfig. # noqa: E501 :type: str
image
python
kserve/kserve
python/kserve/kserve/models/v1beta1_predictor_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_predictor_config.py
Apache-2.0
def supported_frameworks(self, supported_frameworks): """Sets the supported_frameworks of this V1beta1PredictorConfig. frameworks the model agent is able to run # noqa: E501 :param supported_frameworks: The supported_frameworks of this V1beta1PredictorConfig. # noqa: E501 :type: list...
Sets the supported_frameworks of this V1beta1PredictorConfig. frameworks the model agent is able to run # noqa: E501 :param supported_frameworks: The supported_frameworks of this V1beta1PredictorConfig. # noqa: E501 :type: list[str]
supported_frameworks
python
kserve/kserve
python/kserve/kserve/models/v1beta1_predictor_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_predictor_config.py
Apache-2.0
def name(self, name): """Sets the name of this V1beta1ResourceMetricSource. name is the name of the resource in question. # noqa: E501 :param name: The name of this V1beta1ResourceMetricSource. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_v...
Sets the name of this V1beta1ResourceMetricSource. name is the name of the resource in question. # noqa: E501 :param name: The name of this V1beta1ResourceMetricSource. # noqa: E501 :type: str
name
python
kserve/kserve
python/kserve/kserve/models/v1beta1_resource_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_resource_metric_source.py
Apache-2.0
def target(self, target): """Sets the target of this V1beta1ResourceMetricSource. :param target: The target of this V1beta1ResourceMetricSource. # noqa: E501 :type: V1beta1MetricTarget """ if self.local_vars_configuration.client_side_validation and target is None: # noqa: E50...
Sets the target of this V1beta1ResourceMetricSource. :param target: The target of this V1beta1ResourceMetricSource. # noqa: E501 :type: V1beta1MetricTarget
target
python
kserve/kserve
python/kserve/kserve/models/v1beta1_resource_metric_source.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_resource_metric_source.py
Apache-2.0
def auto_mount_service_account_token(self, auto_mount_service_account_token): """Sets the auto_mount_service_account_token of this V1beta1SecurityConfig. :param auto_mount_service_account_token: The auto_mount_service_account_token of this V1beta1SecurityConfig. # noqa: E501 :type: bool ...
Sets the auto_mount_service_account_token of this V1beta1SecurityConfig. :param auto_mount_service_account_token: The auto_mount_service_account_token of this V1beta1SecurityConfig. # noqa: E501 :type: bool
auto_mount_service_account_token
python
kserve/kserve
python/kserve/kserve/models/v1beta1_security_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_security_config.py
Apache-2.0
def default_image_version(self, default_image_version): """Sets the default_image_version of this V1beta1TransformerConfig. default transformer docker image version # noqa: E501 :param default_image_version: The default_image_version of this V1beta1TransformerConfig. # noqa: E501 :ty...
Sets the default_image_version of this V1beta1TransformerConfig. default transformer docker image version # noqa: E501 :param default_image_version: The default_image_version of this V1beta1TransformerConfig. # noqa: E501 :type: str
default_image_version
python
kserve/kserve
python/kserve/kserve/models/v1beta1_transformer_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_transformer_config.py
Apache-2.0
def image(self, image): """Sets the image of this V1beta1TransformerConfig. transformer docker image name # noqa: E501 :param image: The image of this V1beta1TransformerConfig. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and ima...
Sets the image of this V1beta1TransformerConfig. transformer docker image name # noqa: E501 :param image: The image of this V1beta1TransformerConfig. # noqa: E501 :type: str
image
python
kserve/kserve
python/kserve/kserve/models/v1beta1_transformer_config.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/models/v1beta1_transformer_config.py
Apache-2.0
async def get_model(self, name: str) -> BaseKServeModel: """Get the model instance with the given name. Args: name (str): Model name. Returns: ModelHandleType: Instance of the model. """ model = self._model_registry.get_model(name) if model is No...
Get the model instance with the given name. Args: name (str): Model name. Returns: ModelHandleType: Instance of the model.
get_model
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
def get_binary_cloudevent( body: Union[str, bytes, None], headers: Dict[str, str] ) -> CloudEvent: """Helper function to parse CloudEvent body and headers. Args: body (str|bytes|None): Request body. headers (Dict[str, str]): Request headers. Returns: ...
Helper function to parse CloudEvent body and headers. Args: body (str|bytes|None): Request body. headers (Dict[str, str]): Request headers. Returns: CloudEvent: A CloudEvent instance parsed from http body and headers. Raises: InvalidInput: An er...
get_binary_cloudevent
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def live() -> Dict[str, str]: """Server live. Returns ``{"status": "alive"}`` on successful invocation. Primarily meant to be used for Kubernetes liveness check. Returns: Dict: {"status": "alive"} """ return {"status": "alive"}
Server live. Returns ``{"status": "alive"}`` on successful invocation. Primarily meant to be used for Kubernetes liveness check. Returns: Dict: {"status": "alive"}
live
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
def metadata(self) -> Dict: """Server metadata. Note: Supports ``model_repository_extension`` as defined at Triton Server `Model Repository Extension`_. Returns: Returns a dict object with following fields: - name (str): name of the server. ...
Server metadata. Note: Supports ``model_repository_extension`` as defined at Triton Server `Model Repository Extension`_. Returns: Returns a dict object with following fields: - name (str): name of the server. - version (str): server version numb...
metadata
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def model_metadata(self, model_name: str) -> Dict: """Get metadata for a specific model. Args: model_name (str): Model name Returns: Dict: dictionary with following fields: - name (str): name of the model - platform: "" (Empty Stri...
Get metadata for a specific model. Args: model_name (str): Model name Returns: Dict: dictionary with following fields: - name (str): name of the model - platform: "" (Empty String) - inputs: Dict with below fields ...
model_metadata
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def ready(self) -> bool: """Server ready. Returns ``True``. Primarily meant to be used as Kubernetes readiness check. Returns: bool: True """ # If predictor host is present, then it means this is a transformer, # We should also need to check the predic...
Server ready. Returns ``True``. Primarily meant to be used as Kubernetes readiness check. Returns: bool: True
ready
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def model_ready( self, model_name: str, disable_predictor_health_check: bool = False ) -> bool: """Check if a model is ready. Args: model_name (str): name of the model disable_predictor_health_check (bool): Flag to disable predictor health check for...
Check if a model is ready. Args: model_name (str): name of the model disable_predictor_health_check (bool): Flag to disable predictor health check for infer/predict requests. Returns: bool: True if the model is ready, False otherwise. Raises: ...
model_ready
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def infer( self, model_name: str, request: Union[Dict, InferRequest], headers: Optional[Dict[str, str]] = None, ) -> Tuple[Union[Dict, InferResponse], Dict[str, str]]: """Performs inference on the specified model with the provided body and headers. If the ``bod...
Performs inference on the specified model with the provided body and headers. If the ``body`` contains an encoded `CloudEvent`_, then it will be decoded and processed. The response body/headers will also be encoded as CloudEvents. Args: model_name (str): Model name. req...
infer
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
async def explain( self, model_name: str, request: Union[bytes, Dict, InferRequest], headers: Optional[Dict[str, str]] = None, ) -> Tuple[Union[str, bytes, Dict, InferResponse], Dict[str, str]]: """Performs explanation for the specified model. Args: model...
Performs explanation for the specified model. Args: model_name (str): Model name to be used for explanation. request (bytes|Dict): Request body data. headers: (Optional[Dict[str, str]]): Request headers. Returns: Dict: Explanation result. Raises...
explain
python
kserve/kserve
python/kserve/kserve/protocol/dataplane.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/dataplane.py
Apache-2.0
def serialize_byte_tensor(input_tensor: np.ndarray) -> np.ndarray: """ Serializes a bytes tensor into a flat numpy array of length prepended bytes. The numpy array should use dtype of np.object. For np.bytes, numpy will remove trailing zeros at the end of byte sequence and because of this it should ...
Serializes a bytes tensor into a flat numpy array of length prepended bytes. The numpy array should use dtype of np.object. For np.bytes, numpy will remove trailing zeros at the end of byte sequence and because of this it should be avoided. Args: input_tensor : np.array The byt...
serialize_byte_tensor
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def deserialize_bytes_tensor(encoded_tensor: bytes) -> np.ndarray: """ Deserializes an encoded bytes tensor into a numpy array of dtype of python objects Args: encoded_tensor : bytes The encoded bytes tensor where each element has its length in first 4 bytes followed by ...
Deserializes an encoded bytes tensor into a numpy array of dtype of python objects Args: encoded_tensor : bytes The encoded bytes tensor where each element has its length in first 4 bytes followed by the content Returns: string_tensor : np.array ...
deserialize_bytes_tensor
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def parameters( self, params: Optional[Union[Dict, MessageMap[str, InferParameter]]] ): """Set the parameters of the inference input associated with this object. Args: params: parameters of the inference input """ self._parameters = params
Set the parameters of the inference input associated with this object. Args: params: parameters of the inference input
parameters
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def as_string(self) -> List[List[str]]: """ Decodes the inference input data as a list of strings. Returns: List[List[str]]: The decoded data as a list of strings. Raises: InvalidInput: If the datatype of the inference input is not 'BYTES'. """ i...
Decodes the inference input data as a list of strings. Returns: List[List[str]]: The decoded data as a list of strings. Raises: InvalidInput: If the datatype of the inference input is not 'BYTES'.
as_string
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def as_numpy(self) -> np.ndarray: """Decode the inference input data as numpy array. Returns: A numpy array of the inference input data Raises: InvalidInput: If the datatype of the inference input is not recognized. """ dtype = to_np_dtype(self.datatype) ...
Decode the inference input data as numpy array. Returns: A numpy array of the inference input data Raises: InvalidInput: If the datatype of the inference input is not recognized.
as_numpy
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def set_data_from_numpy(self, input_tensor: np.ndarray, binary_data: bool = True): """Set the tensor data from the specified numpy array for input associated with this object. Args: input_tensor : The tensor data in numpy array format. binary_data : Indicates whether to set data...
Set the tensor data from the specified numpy array for input associated with this object. Args: input_tensor : The tensor data in numpy array format. binary_data : Indicates whether to set data for the input in binary format or explicit tensor within JSON. The ...
set_data_from_numpy
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def __init__(self, name: str, parameters: Optional[Dict] = None): """ The RequestedOutput class represents an output that is requested as part of an inference request. Args: name (str): The name of the output. parameters (Optional[Dict]): Additional parameters for the ou...
The RequestedOutput class represents an output that is requested as part of an inference request. Args: name (str): The name of the output. parameters (Optional[Dict]): Additional parameters for the output.
__init__
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def binary_data(self) -> Optional[bool]: """Get the binary_data attribute from the parameters. This attribute indicates whether the data for the input should be in binary format. Returns: bool or None: True if the data should be in binary format, False otherwise. ...
Get the binary_data attribute from the parameters. This attribute indicates whether the data for the input should be in binary format. Returns: bool or None: True if the data should be in binary format, False otherwise. If the binary_data attribute is not set, ...
binary_data
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def __init__( self, model_name: str, infer_inputs: List[InferInput], request_id: Optional[str] = None, raw_inputs=None, from_grpc: Optional[bool] = False, parameters: Optional[Union[Dict, MessageMap[str, InferParameter]]] = None, request_outputs: Optional[...
InferRequest Data Model. Args: model_name: The model name. infer_inputs: The inference inputs for the model. request_id: The id for the inference request. raw_inputs: The binary data for the inference inputs. from_grpc: Indicate if the data model is c...
__init__
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def use_binary_outputs(self) -> bool: """This attribute is used to determine if all the outputs should be returned as raw binary format. For REST, Get the binary_data_output attribute from the parameters. This will be ovverided by the individual output's 'binary_data' parameter. For ...
This attribute is used to determine if all the outputs should be returned as raw binary format. For REST, Get the binary_data_output attribute from the parameters. This will be ovverided by the individual output's 'binary_data' parameter. For GRPC, It is True, if the received inp...
use_binary_outputs
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_grpc(cls, request: ModelInferRequest) -> "InferRequest": """ Class method to construct an InferRequest object from a ModelInferRequest object. Args: request (ModelInferRequest): The gRPC ModelInferRequest object to be converted. Returns: InferRequest: T...
Class method to construct an InferRequest object from a ModelInferRequest object. Args: request (ModelInferRequest): The gRPC ModelInferRequest object to be converted. Returns: InferRequest: The resulting InferRequest object.
from_grpc
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_bytes( cls, req_bytes: bytes, json_length: int, model_name: str ) -> "InferRequest": """The class method to construct the InferRequest object from REST raw request bytes. Args: req_bytes (bytes): The raw InferRequest in bytes. json_length (int): The length o...
The class method to construct the InferRequest object from REST raw request bytes. Args: req_bytes (bytes): The raw InferRequest in bytes. json_length (int): The length of the json bytes. model_name (str): The name of the model. Returns: InferRequest: Th...
from_bytes
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_inference_request( cls, request: InferenceRequest, model_name: str ) -> "InferRequest": """The class method to construct the InferRequest object from InferenceRequest object. Args: request (InferenceRequest): The InferenceRequest object. model_name (str): Th...
The class method to construct the InferRequest object from InferenceRequest object. Args: request (InferenceRequest): The InferenceRequest object. model_name (str): The name of the model. Returns: InferRequest: The resulting InferRequest object. Raises: ...
from_inference_request
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_rest(self) -> Tuple[Union[bytes, Dict], Optional[int]]: """ Converts the InferRequest object to v2 REST InferRequest Dict or bytes. This method is used to convert the InferRequest object into a format that can be sent over a REST API. Returns: Tuple[Union[bytes, Dict]...
Converts the InferRequest object to v2 REST InferRequest Dict or bytes. This method is used to convert the InferRequest object into a format that can be sent over a REST API. Returns: Tuple[Union[bytes, Dict], Optional[int]]: A tuple containing the InferRequest in bytes or Dict and...
to_rest
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_grpc(self) -> ModelInferRequest: """Converts the InferRequest object to gRPC ModelInferRequest type. Returns: ModelInferRequest gRPC type converted from InferRequest object. """ infer_inputs = [] raw_input_contents = [] for infer_input in self.inputs: ...
Converts the InferRequest object to gRPC ModelInferRequest type. Returns: ModelInferRequest gRPC type converted from InferRequest object.
to_grpc
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def as_dataframe(self) -> pd.DataFrame: """Decode the tensor inputs as pandas dataframe. Returns: The inference input data as pandas dataframe """ dfs = [] for input in self.inputs: input_data = input.data if input.datatype == "BYTES": ...
Decode the tensor inputs as pandas dataframe. Returns: The inference input data as pandas dataframe
as_dataframe
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def get_input_by_name(self, name: str) -> Optional[InferInput]: """Find an input Tensor in the InferenceRequest that has the given name Args: name : str name of the input Tensor object Returns: InferInput The InferInput with the specified n...
Find an input Tensor in the InferenceRequest that has the given name Args: name : str name of the input Tensor object Returns: InferInput The InferInput with the specified name, or None if no input with this name exists
get_input_by_name
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def __init__( self, name: str, shape: List[int], datatype: str, data: Union[List, np.ndarray, InferTensorContents] = None, parameters: Optional[Union[Dict, MessageMap[str, InferParameter]]] = None, ): """An object of InferOutput class is used to describe the o...
An object of InferOutput class is used to describe the output tensor for an inference response. Args: name : The name of inference output whose data will be described by this object. shape : The shape of the associated inference output. datatype : The data type of the associ...
__init__
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def as_numpy(self) -> np.ndarray: """Decode the tensor output data as numpy array. Returns: The numpy array of the associated inference output data. """ dtype = to_np_dtype(self.datatype) if dtype is None: raise InvalidInput("invalid datatype in the input...
Decode the tensor output data as numpy array. Returns: The numpy array of the associated inference output data.
as_numpy
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def set_data_from_numpy(self, output_tensor: np.ndarray, binary_data: bool = True): """Set the tensor data from the specified numpy array for the inference output associated with this object. Args: output_tensor : The tensor data in numpy array format. binary_data : Indicates wh...
Set the tensor data from the specified numpy array for the inference output associated with this object. Args: output_tensor : The tensor data in numpy array format. binary_data : Indicates whether to set data for the input in binary format or explicit tensor w...
set_data_from_numpy
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def __init__( self, response_id: str, model_name: str, infer_outputs: List[InferOutput], model_version: Optional[str] = None, raw_outputs=None, from_grpc: Optional[bool] = False, parameters: Optional[Union[Dict, MessageMap[str, InferParameter]]] = None, ...
The InferResponse Data Model Args: response_id: The id of the inference response. model_name: The name of the model. infer_outputs: The inference outputs of the inference response. model_version: The version of the model. raw_outputs: The raw binary d...
__init__
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_grpc(cls, response: ModelInferResponse) -> "InferResponse": """The class method to construct the InferResponse object from gRPC message type. Args: response: The GRPC response as ModelInferResponse object. Returns: InferResponse object. """ infer...
The class method to construct the InferResponse object from gRPC message type. Args: response: The GRPC response as ModelInferResponse object. Returns: InferResponse object.
from_grpc
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_rest(cls, response: Dict) -> "InferResponse": """The class method to construct the InferResponse object from REST message type. Args: response: The response as a dict. Returns: InferResponse object. """ infer_outputs = [ InferOutput( ...
The class method to construct the InferResponse object from REST message type. Args: response: The response as a dict. Returns: InferResponse object.
from_rest
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def from_bytes( cls, res_bytes: bytes, json_length: int, ) -> "InferResponse": """ Class method to construct an InferResponse object from raw response bytes. This method is used to convert the raw response bytes received from a REST API into an InferResponse object. ...
Class method to construct an InferResponse object from raw response bytes. This method is used to convert the raw response bytes received from a REST API into an InferResponse object. Args: res_bytes (bytes): The raw response bytes received from the REST API. json_lengt...
from_bytes
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_rest(self) -> Tuple[Union[bytes, Dict], Optional[int]]: """ Converts the InferResponse object to v2 REST InferResponse Dict or bytes. This method is used to convert the InferResponse object into a format that can be sent over a REST API. Returns: Tuple[Union[bytes, Di...
Converts the InferResponse object to v2 REST InferResponse Dict or bytes. This method is used to convert the InferResponse object into a format that can be sent over a REST API. Returns: Tuple[Union[bytes, Dict], Optional[int]]: A tuple containing the InferResponse in bytes or Dict...
to_rest
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_grpc(self) -> ModelInferResponse: """Converts the InferResponse object to gRPC ModelInferResponse type. Returns: The ModelInferResponse gRPC message. Raises: InvalidInput: If the output data is not a List or if the datatype is invalid. """ infer_ou...
Converts the InferResponse object to gRPC ModelInferResponse type. Returns: The ModelInferResponse gRPC message. Raises: InvalidInput: If the output data is not a List or if the datatype is invalid.
to_grpc
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def get_output_by_name(self, name: str) -> Optional[InferOutput]: """Find an output Tensor in the InferResponse that has the given name Args: name : str name of the output Tensor object Returns: InferOutput The InferOutput with the specifi...
Find an output Tensor in the InferResponse that has the given name Args: name : str name of the output Tensor object Returns: InferOutput The InferOutput with the specified name, or None if no output with this name exists
get_output_by_name
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_grpc_parameters( parameters: Union[ Dict[str, Union[str, bool, int]], MessageMap[str, InferParameter] ], ) -> Dict[str, InferParameter]: """ Converts REST parameters to GRPC InferParameter objects :param parameters: parameters to be converted. :return: converted parameters as Dic...
Converts REST parameters to GRPC InferParameter objects :param parameters: parameters to be converted. :return: converted parameters as Dict[str, InferParameter] :raises InvalidInput: if the parameter type is not supported.
to_grpc_parameters
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def to_http_parameters( parameters: Union[dict, MessageMap[str, InferParameter]], ) -> Dict[str, Union[str, bool, int]]: """ Converts GRPC InferParameter parameters to REST parameters :param parameters: parameters to be converted. :return: converted parameters as Dict[str, Union[str, bool, int]] ...
Converts GRPC InferParameter parameters to REST parameters :param parameters: parameters to be converted. :return: converted parameters as Dict[str, Union[str, bool, int]]
to_http_parameters
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
def _contains_fp16_datatype(infer_response: InferResponse) -> bool: """ Checks whether the InferResponse outputs contains FP16 datatype. :param infer_response: An InferResponse object containing model inference results. :return: A boolean indicating whether any output in the InferResponse uses the FP16...
Checks whether the InferResponse outputs contains FP16 datatype. :param infer_response: An InferResponse object containing model inference results. :return: A boolean indicating whether any output in the InferResponse uses the FP16 datatype.
_contains_fp16_datatype
python
kserve/kserve
python/kserve/kserve/protocol/infer_type.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/infer_type.py
Apache-2.0
async def index(self, filter_ready: Optional[bool] = False) -> List[Dict[str, str]]: """Returns information about every model available in a model repository. Args: filter_ready: When set True, the function returns only the models that are ready Returns: List[Dict[str, ...
Returns information about every model available in a model repository. Args: filter_ready: When set True, the function returns only the models that are ready Returns: List[Dict[str, str]]: list with metadata for models as below: { name: mode...
index
python
kserve/kserve
python/kserve/kserve/protocol/model_repository_extension.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/model_repository_extension.py
Apache-2.0
async def load(self, model_name: str) -> None: """Loads the specified model. Args: model_name (str): name of the model to load. Returns: None Raises: ModelNotReady: Exception if model loading fails. """ try: # For backward compatibil...
Loads the specified model. Args: model_name (str): name of the model to load. Returns: None Raises: ModelNotReady: Exception if model loading fails.
load
python
kserve/kserve
python/kserve/kserve/protocol/model_repository_extension.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/model_repository_extension.py
Apache-2.0
async def unload(self, model_name: str) -> None: """Unload the specified model. Args: model_name (str): Name of the model to unload. Returns: None Raises: ModelNotFound: Exception if the requested model is not found. """ try: self._m...
Unload the specified model. Args: model_name (str): Name of the model to unload. Returns: None Raises: ModelNotFound: Exception if the requested model is not found.
unload
python
kserve/kserve
python/kserve/kserve/protocol/model_repository_extension.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/model_repository_extension.py
Apache-2.0
def ServerLive(self, request, context): """The ServerLive API indicates if the inference server is able to receive and respond to metadata and inference requests. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise Not...
The ServerLive API indicates if the inference server is able to receive and respond to metadata and inference requests.
ServerLive
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def ServerReady(self, request, context): """The ServerReady API indicates if the server is ready for inferencing. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
The ServerReady API indicates if the server is ready for inferencing.
ServerReady
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def ModelReady(self, request, context): """The ModelReady API indicates if a specific model is ready for inferencing. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
The ModelReady API indicates if a specific model is ready for inferencing.
ModelReady
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def ServerMetadata(self, request, context): """The ServerMetadata API provides information about the server. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure. """ context.set_code(grpc.StatusC...
The ServerMetadata API provides information about the server. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure.
ServerMetadata
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def ModelMetadata(self, request, context): """The per-model metadata API provides information about a model. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure. """ context.set_code(grpc.StatusC...
The per-model metadata API provides information about a model. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure.
ModelMetadata
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def ModelInfer(self, request, context): """The ModelInfer API performs inference using the specified model. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure. """ context.set_code(grpc.StatusCod...
The ModelInfer API performs inference using the specified model. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure.
ModelInfer
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
def RepositoryModelLoad(self, request, context): """Load or reload a model from a repository. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
Load or reload a model from a repository.
RepositoryModelLoad
python
kserve/kserve
python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/grpc/grpc_predict_v2_pb2_grpc.py
Apache-2.0
async def start(self): """Starts the server without configuring the event loop.""" self.create_application() logger.info("Starting uvicorn with %s workers", self.config.workers) await self._server.serve()
Starts the server without configuring the event loop.
start
python
kserve/kserve
python/kserve/kserve/protocol/rest/server.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/server.py
Apache-2.0
async def models(self) -> Dict[str, List[str]]: """Get a list of models in the model registry. Returns: Dict[str, List[str]]: List of model names. """ return {"models": list(self.dataplane.model_registry.get_models().keys())}
Get a list of models in the model registry. Returns: Dict[str, List[str]]: List of model names.
models
python
kserve/kserve
python/kserve/kserve/protocol/rest/v1_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v1_endpoints.py
Apache-2.0
async def model_ready(self, model_name: str) -> Dict[str, Union[str, bool]]: """Check if a given model is ready. Args: model_name (str): Model name. Returns: Dict[str, Union[str, bool]]: Name of the model and whether it's ready. """ model_ready = await s...
Check if a given model is ready. Args: model_name (str): Model name. Returns: Dict[str, Union[str, bool]]: Name of the model and whether it's ready.
model_ready
python
kserve/kserve
python/kserve/kserve/protocol/rest/v1_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v1_endpoints.py
Apache-2.0
async def predict(self, model_name: str, request: Request) -> Union[Response, Dict]: """Predict request handler. It sends the request to the dataplane where the model will process the request body. Args: model_name (str): Model name. request (Request): Raw request objec...
Predict request handler. It sends the request to the dataplane where the model will process the request body. Args: model_name (str): Model name. request (Request): Raw request object. Returns: Dict|Response: Model inference response.
predict
python
kserve/kserve
python/kserve/kserve/protocol/rest/v1_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v1_endpoints.py
Apache-2.0
async def explain(self, model_name: str, request: Request) -> Union[Response, Dict]: """Explain handler. Args: model_name (str): Model name. request (Request): Raw request object. Returns: Dict: Explainer output. """ # Disable predictor healt...
Explain handler. Args: model_name (str): Model name. request (Request): Raw request object. Returns: Dict: Explainer output.
explain
python
kserve/kserve
python/kserve/kserve/protocol/rest/v1_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v1_endpoints.py
Apache-2.0
def register_v1_endpoints( app: FastAPI, dataplane: DataPlane, model_repository_extension: Optional[ModelRepositoryExtension], ): """Register V1 endpoints. Args: app (FastAPI): FastAPI app. dataplane (DataPlane): DataPlane object. model_repository_extension (Optional[ModelRe...
Register V1 endpoints. Args: app (FastAPI): FastAPI app. dataplane (DataPlane): DataPlane object. model_repository_extension (Optional[ModelRepositoryExtension]): Model repository extension.
register_v1_endpoints
python
kserve/kserve
python/kserve/kserve/protocol/rest/v1_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v1_endpoints.py
Apache-2.0
async def metadata(self) -> ServerMetadataResponse: """Server metadata endpoint. Returns: ServerMetadataResponse: Server metadata JSON object. """ return ServerMetadataResponse.model_validate(self.dataplane.metadata())
Server metadata endpoint. Returns: ServerMetadataResponse: Server metadata JSON object.
metadata
python
kserve/kserve
python/kserve/kserve/protocol/rest/v2_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v2_endpoints.py
Apache-2.0
async def live(self) -> ServerLiveResponse: """Server live endpoint. Returns: ServerLiveResponse: Server live message. """ response = await self.dataplane.live() is_live = response["status"] == "alive" if not is_live: raise ServerNotLive() ...
Server live endpoint. Returns: ServerLiveResponse: Server live message.
live
python
kserve/kserve
python/kserve/kserve/protocol/rest/v2_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v2_endpoints.py
Apache-2.0
async def ready(self) -> ServerReadyResponse: """Server ready endpoint. Returns: ServerReadyResponse: Server ready message. """ is_ready = await self.dataplane.ready() if not is_ready: raise ServerNotReady() return ServerReadyResponse(ready=is_rea...
Server ready endpoint. Returns: ServerReadyResponse: Server ready message.
ready
python
kserve/kserve
python/kserve/kserve/protocol/rest/v2_endpoints.py
https://github.com/kserve/kserve/blob/master/python/kserve/kserve/protocol/rest/v2_endpoints.py
Apache-2.0