Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
kserve | kserve-master/config/rbac/role_binding.yaml | apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kserve-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kserve-manager-role
subjects:
- kind: ServiceAccount
name: kserve-controller-manager
| 273 | 21.833333 | 40 | yaml |
kserve | kserve-master/config/rbac/service_account.yaml | apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: kserve-controller-manager
app.kubernetes.io/managed-by: kserve-controller-manager
app.kubernetes.io/name: kserve-controller-manager
name: kserve-controller-manager
| 262 | 28.222222 | 59 | yaml |
kserve | kserve-master/config/runtimes/kserve-lgbserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-lgbserver
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: lightgbm
version: "3"
autoSelect: true
protocolVersions:
- v1
... | 662 | 21.1 | 41 | yaml |
kserve | kserve-master/config/runtimes/kserve-mlserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-mlserver
spec:
annotations:
# mlserver version 1.1.0 uses port 8082 as default instead of 8080.
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: sklearn
... | 1,065 | 23.227273 | 71 | yaml |
kserve | kserve-master/config/runtimes/kserve-paddleserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-paddleserver
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: paddle
version: "2"
autoSelect: true
protocolVersions:
- v1... | 644 | 21.241379 | 41 | yaml |
kserve | kserve-master/config/runtimes/kserve-pmmlserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-pmmlserver
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: pmml
version: "3"
autoSelect: true
- name: pmml
version: ... | 697 | 20.8125 | 41 | yaml |
kserve | kserve-master/config/runtimes/kserve-sklearnserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-sklearnserver
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: sklearn
version: "1"
autoSelect: true
protocolVersions:
- ... | 647 | 21.344828 | 41 | yaml |
kserve | kserve-master/config/runtimes/kserve-tensorflow-serving.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-tensorflow-serving
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: tensorflow
version: "1"
autoSelect: true
- name: tensor... | 855 | 22.777778 | 49 | yaml |
kserve | kserve-master/config/runtimes/kserve-torchserve.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-torchserve
spec:
annotations:
prometheus.kserve.io/port: '8082'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: pytorch
version: "1"
autoSelect: true
protocolVersions:
- v1
... | 812 | 22.228571 | 58 | yaml |
kserve | kserve-master/config/runtimes/kserve-tritonserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-tritonserver
spec:
annotations:
prometheus.kserve.io/port: '8002'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: tensorrt
version: "8"
autoSelect: true
- name: tensorflow
... | 1,024 | 20.808511 | 41 | yaml |
kserve | kserve-master/config/runtimes/kserve-xgbserver.yaml | apiVersion: serving.kserve.io/v1alpha1
kind: ClusterServingRuntime
metadata:
name: kserve-xgbserver
spec:
annotations:
prometheus.kserve.io/port: '8080'
prometheus.kserve.io/path: "/metrics"
supportedModelFormats:
- name: xgboost
version: "1"
autoSelect: true
protocolVersions:
- v1
... | 661 | 21.066667 | 41 | yaml |
kserve | kserve-master/config/runtimes/kustomization.yaml | apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- kserve-tensorflow-serving.yaml
- kserve-sklearnserver.yaml
- kserve-mlserver.yaml
- kserve-xgbserver.yaml
- kserve-tritonserver.yaml
- kserve-pmmlserver.yaml
- kserve-paddleserver.yaml
- kserve-lgbserver.yaml
- kserve-torchserve.yaml
images:... | 1,025 | 18.730769 | 43 | yaml |
kserve | kserve-master/config/webhook/kustomization.yaml | apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- manifests.yaml
- service.yaml
| 108 | 14.571429 | 43 | yaml |
kserve | kserve-master/config/webhook/manifests.yaml | ---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: inferenceservice.serving.kserve.io
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: $(webhookServiceName)
namespace: $(kserveNamespace)
path: /mutat... | 3,577 | 24.927536 | 66 | yaml |
kserve | kserve-master/config/webhook/service.yaml | apiVersion: v1
kind: Service
metadata:
name: kserve-webhook-server-service
namespace: kserve
spec:
ports:
- port: 443
targetPort: webhook-server
selector:
control-plane: kserve-controller-manager
| 218 | 17.25 | 44 | yaml |
kserve | kserve-master/docs/DEVELOPER_GUIDE.md | # Developer Guide
Please review the [KServe Developer Guide](https://github.com/kserve/website/blob/main/docs/developer/developer.md) docs.
| 142 | 27.6 | 121 | md |
kserve | kserve-master/docs/KFSERVING_DEBUG_GUIDE.md | Please review the [KServe Debugging Guide](https://github.com/kserve/website/blob/main/docs/developer/debug.md) docs.
| 118 | 58.5 | 117 | md |
kserve | kserve-master/docs/MULTIMODELSERVING_GUIDE.md | # Multi-Model Serving
Multi-model serving is an [alpha](https://kubernetes.io/docs/reference/using-api/#api-versioning)
feature added recently to increase KFServing’s scalability.
Please assume that the interface is subject to changes.
## The model deployment scalability problem
With machine learning approaches becom... | 7,476 | 71.592233 | 227 | md |
kserve | kserve-master/docs/OPENSHIFT_GUIDE.md | # KServe on OpenShift Container Platform
[OpenShift Container Platform](https://www.openshift.com/products/container-platform) is built on top of Kubernetes, and offers a consistent hybrid cloud foundation for building and scaling containerized applications.
# Contents
1. [Installation](#installation)
2. [Test KServ... | 8,618 | 38 | 293 | md |
kserve | kserve-master/docs/PRESENTATIONS.md | Please see the list of [presentations, talks and books](https://github.com/kserve/website/blob/main/docs/community/presentations.md) on website repository
| 155 | 77 | 154 | md |
kserve | kserve-master/docs/README.md | # Architecture Overview
Please review KServe [Control Plane](https://github.com/kserve/website/blob/main/docs/modelserving/control_plane.md)
and [Data Plane](https://github.com/kserve/website/blob/main/docs/modelserving/data_plane/data_plane.md) docs.
| 253 | 49.8 | 116 | md |
kserve | kserve-master/docs/apis/v1beta1/README.md | # Inference Service API Reference
Please review the [InferenceService API Reference](https://github.com/kserve/website/blob/main/docs/reference/api.md). | 153 | 50.333333 | 118 | md |
kserve | kserve-master/docs/guidelines/kubeflow_kfserving_requirements.md | # KFServing Requirements for Kubeflow 1.0
- KFServing Authors: singhan@us.ibm.com
- Kubeflow Authors: chasm@google.com, jlewi@google.com, kam.d.kasravi@intel.com
## Objective
The purpose of this doc is to define requirements and recommendations aimed at graduating KFServing in Kubeflow to 1.0.
The main goals are to... | 7,621 | 78.395833 | 633 | md |
kserve | kserve-master/docs/openshift/networkpolicies.yaml | ---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: kserve-controller-manager
namespace: kserve
spec:
podSelector:
matchLabels:
control-plane: kserve-controller-manager
ingress:
- {} | 225 | 17.833333 | 46 | yaml |
kserve | kserve-master/docs/openshift/cert-manager/operator.yaml | ---
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: cert-manager-operator-og
namespace: cert-manager-operator
spec:
targetNamespaces:
- cert-manager-operator
upgradeStrategy: Default
---
apiVersion: operators.... | 592 | 20.962963 | 41 | yaml |
kserve | kserve-master/docs/openshift/serverless/gateways.yaml | apiVersion: v1
kind: Service
metadata:
labels:
experimental.istio.io/disable-gateway-port-translation: "true"
name: knative-local-gateway
namespace: istio-system
spec:
ports:
- name: http2
port: 80
protocol: TCP
targetPort: 8081
selector:
istio: ingressgateway
type: ClusterIP
-... | 4,793 | 76.322581 | 2,283 | yaml |
kserve | kserve-master/docs/openshift/serverless/knativeserving-istio.yaml | apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
annotations:
serverless.openshift.io/default-enable-http2: "true"
spec:
deployments:
- annotations:
sidecar.istio.io/inject: "true"
sidecar.istio.io/rewriteAppHTTPProb... | 532 | 25.65 | 56 | yaml |
kserve | kserve-master/docs/openshift/serverless/knativeserving-kourier.yaml | apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
annotations:
serverless.openshift.io/default-enable-http2: "true"
spec:
ingress:
kourier:
enabled: true
| 247 | 19.666667 | 56 | yaml |
kserve | kserve-master/docs/openshift/serverless/operator.yaml | ---
apiVersion: v1
kind: Namespace
metadata:
name: openshift-serverless
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: serverless-operators
namespace: openshift-serverless
spec: {}
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: serverless-operator
... | 476 | 18.875 | 41 | yaml |
kserve | kserve-master/docs/openshift/service-mesh/namespace.yaml | apiVersion: v1
kind: Namespace
metadata:
name: istio-system | 61 | 14.5 | 20 | yaml |
kserve | kserve-master/docs/openshift/service-mesh/operators.yaml | ---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: servicemeshoperator
namespace: openshift-operators
spec:
channel: stable
name: servicemeshoperator
installPlanApproval: Automatic
source: redhat-operators
sourceNamespace: openshift-marketplace
---
apiVersion: operators.coreo... | 839 | 21.702703 | 41 | yaml |
kserve | kserve-master/docs/openshift/service-mesh/peer-authentication.yaml | apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: istio-system
spec:
mtls:
mode: STRICT
---
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: knative-serving
spec:
mtls:
mode: STRICT
---
apiVersion: secur... | 595 | 15.555556 | 37 | yaml |
kserve | kserve-master/docs/openshift/service-mesh/smcp.yaml | apiVersion: maistra.io/v2
kind: ServiceMeshControlPlane
metadata:
name: basic
namespace: istio-system
spec:
addons:
grafana:
enabled: false
kiali:
enabled: false
prometheus:
enabled: false
security:
dataPlane:
mtls: false # otherwise inference-graph will not work. We use ... | 388 | 20.611111 | 110 | yaml |
kserve | kserve-master/docs/openshift/service-mesh/smmr.yaml | apiVersion: maistra.io/v1
kind: ServiceMeshMemberRoll
metadata:
name: default
namespace: istio-system
spec:
members:
- knative-serving
- kserve
- kserve-demo
| 176 | 15.090909 | 27 | yaml |
kserve | kserve-master/docs/predict-api/v2/README.md | # Predict Protocol - Version 2
The *Predict Protocol, version 2* is a set of HTTP/REST and GRPC APIs
for inference / prediction servers. By implementing this protocol both
inference clients and servers will increase their utility and
portability by being able to operate seamlessly on platforms that have
standardized a... | 1,113 | 41.846154 | 77 | md |
kserve | kserve-master/docs/predict-api/v2/required_api.md | # Predict Protocol - Version 2
This document proposes a predict/inference API independent of any
specific ML/DL framework and model server. The proposed APIs are
able to support both easy-to-use and high-performance use cases.
By implementing this protocol both
inference clients and servers will increase their utility... | 29,863 | 33.247706 | 90 | md |
kserve | kserve-master/docs/predict-api/v2/rest_predict_v2.yaml | openapi: 3.0.0
info:
title: Data Plane
version: '2.0'
description: 'https://github.com/kubeflow/kfserving/blob/master/docs/predict-api/v2/required_api.md'
license:
name: Apache 2.0
servers: []
paths:
/v2/health/live:
get:
summary: Server Live
responses:
'200':
description... | 10,123 | 28.430233 | 574 | yaml |
kserve | kserve-master/docs/samples/README.md | Please refer to [KServe website repository](https://github.com/kserve/website/tree/main/docs/modelserving) for official example documentation.
| 143 | 71 | 142 | md |
kserve | kserve-master/docs/samples/accelerators/README.md | # GPU Prerequisites
## Install Nvidia Device Drivers
Nvidia drivers must be installed for accelerators to be scheduled to any given node.
Google provides a DaemonSet that automatically installs the drivers for you.
```
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators... | 1,493 | 40.5 | 221 | md |
kserve | kserve-master/docs/samples/accelerators/tensorflow-gpu.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "tensorflow-gpu"
annotations:
"serving.kserve.io/gke-accelerator": "nvidia-tesla-t4"
spec:
predictor:
tensorflow:
storageUri: "gs://kfserving-examples/models/tensorflow/flowers"
runtimeVersion: "1.11.0-gpu"
... | 375 | 24.066667 | 69 | yaml |
kserve | kserve-master/docs/samples/autoscaling/README.md | <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Autoscale InferenceService with your inference workload](#autoscale-inferenceservic... | 11,960 | 33.973684 | 212 | md |
kserve | kserve-master/docs/samples/autoscaling/autoscale.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "flowers-sample"
annotations:
autoscaling.knative.dev/target: "1"
spec:
predictor:
tensorflow:
storageUri: "gs://kfserving-examples/models/tensorflow/flowers"
| 260 | 22.727273 | 69 | yaml |
kserve | kserve-master/docs/samples/autoscaling/autoscale_custom.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "flowers-sample"
spec:
predictor:
containerConcurrency: 10
tensorflow:
storageUri: "gs://kfserving-examples/models/tensorflow/flowers"
| 234 | 22.5 | 69 | yaml |
kserve | kserve-master/docs/samples/autoscaling/autoscale_gpu.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "flowers-sample-gpu"
annotations:
autoscaling.knative.dev/target: "1"
spec:
predictor:
tensorflow:
storageUri: "gs://kfserving-examples/models/tensorflow/flowers"
runtimeVersion: "1.13.0-gpu"
resources:
... | 360 | 23.066667 | 69 | yaml |
kserve | kserve-master/docs/samples/batcher/README.md | # Inference Batcher
We add this module to support batch prediction for any ML frameworks (TensorFlow, PyTorch, ...) without decreasing the performance.
This batcher is implemented in the KServe model agent sidecar, so the requests first hit the agent sidecar, when a batch prediction is triggered
the request is then s... | 1,585 | 41.864865 | 172 | md |
kserve | kserve-master/docs/samples/batcher/basic/README.md | # Inference Batcher Demo
We first create a pytorch predictor with a batcher. The "maxLatency" is set to a big value (5000 milliseconds) to make us be able to observe the batching process.
```
apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "pytorch-batcher"
spec:
predictor:
mi... | 2,483 | 27.551724 | 174 | md |
kserve | kserve-master/docs/samples/batcher/basic/batcher_v1beta1.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "pytorch-batcher"
spec:
predictor:
minReplicas: 1
batcher:
maxBatchSize: 16
maxLatency: 300
pytorch:
storageUri: "gs://kfserving-examples/models/torchserve/image_classifier/v1"
| 292 | 21.538462 | 81 | yaml |
kserve | kserve-master/docs/samples/bentoml/README.md | # Predict on an InferenceService using BentoML
This guide demonstrates how to serve a scikit-learn based iris classifier model with BentoML
and deploying the BentoML model server with KFServing. The same deployment
steps are also applicable for models trained with other machine learning frameworks, see
more BentoML ex... | 6,252 | 32.61828 | 169 | md |
kserve | kserve-master/docs/samples/bentoml/bentoml.yaml | apiVersion: serving.kserve.io/v1alpha2
kind: InferenceService
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: iris-classifier
spec:
default:
predictor:
custom:
container:
image: {docker_username}/iris-classifier
ports:
- containerPort: 5000
| 308 | 19.6 | 50 | yaml |
kserve | kserve-master/docs/samples/canary-testing/README.md | # Canary testing
This tutorial demonstrates canary testing for KServe inference services using model metrics written to Prometheus. We will use [Iter8](https://iter8.tools) to read the metrics from Prometheus and validate service-level objectives (SLOs) for two model versions. [Iter8](https://iter8.tools) is an open-s... | 6,572 | 42.243421 | 427 | md |
kserve | kserve-master/docs/samples/custom-domain/README.md | # Setting up custom domain name
## Motivation
A custom domain is useful in a microservice architecture when you want to expose kfserving outside of kubernetes to other compute resources under a semantic domain. This works especially well in cases where you are using a cloud-provided [Ingress Controller](https://kuber... | 3,981 | 37.660194 | 473 | md |
kserve | kserve-master/docs/samples/custom-domain/kfserving-ingress.yaml | apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kfserving-ingress
namespace: istio-system
spec:
rules:
- host: "<*.custom_domain>"
http:
paths:
- backend:
service:
name: istio-ingressgateway
port:
number: 80
pathType: Impleme... | 336 | 18.823529 | 40 | yaml |
kserve | kserve-master/docs/samples/drift-detection/alibi-detect/cifar10/README.md | # CIFAR10 Drift Detector
A [CIFAR10](https://www.cs.toronto.edu/~kriz/cifar.html) Drift Detector. Run the [notebook demo](cifar10_drift.ipynb) to test.
The notebook requires KNative Eventing >= 0.18.
The architecture used is shown below and links the payload logging available within KFServing with asynchronous proce... | 417 | 37 | 177 | md |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/README.md | # Bias detection on an InferenceService using AIF360
## End-to-end bias detection with german-credit dataset
This is an example of how to get bias metrics using [AI Fairness 360 (AIF360)](https://ai-fairness-360.org/) on KFServing. AI Fairness 360, an LF AI incubation project, is an extensible open source toolkit tha... | 5,132 | 57.329545 | 753 | md |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/bias-v1alpha1.yaml | apiVersion: serving.kserve.io/v1alpha2
kind: InferenceService
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: german-credit
spec:
default:
predictor:
custom:
container:
name: predictor
image: aipipeline/aifserver:predictor
logger:
url: http://message-... | 1,661 | 26.245902 | 74 | yaml |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/bias.yaml | apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: german-credit
spec:
predictor:
containerConcurrency: 0
containers:
- image: aipipeline/aifserver:predictor
name: kfserving-container
resources:
limits:
... | 1,439 | 21.5 | 65 | yaml |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/get_logs.sh | kubectl logs $(kubectl get pod -l serving.knative.dev/service=message-dumper -o jsonpath='{.items[0].metadata.name}') user-container | 132 | 132 | 132 | sh |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/json_from_logs.py | from subprocess import PIPE, run
import json
import yaml
def parse_events(stdout):
line_split = stdout.split('☁️ cloudevents.Event\n')
# Parse the input and output data from the cloud events
log_data = []
for event_iter in range(1, len(line_split)):
event = line_split[event_iter]
co... | 1,474 | 31.065217 | 117 | py |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/message-dumper.yaml | apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: message-dumper
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/minScale: "1"
spec:
containers:
- image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display@sha256:d0ce1d63b4232707f96e... | 365 | 27.153846 | 157 | yaml |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/query_bias.py | import sys
import requests
import json
import time
if len(sys.argv) < 3:
raise Exception("No endpoint specified. ")
endpoint = sys.argv[1]
headers = {
'Host': sys.argv[2]
}
payload_file = "input.json"
if len(sys.argv) > 3:
payload_file = sys.argv[3]
with open(payload_file) as file:
payload = json.lo... | 778 | 18 | 60 | py |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/simulate_predicts.py | import sys
import json
import time
import requests
if len(sys.argv) < 3:
raise Exception("No endpoint specified. ")
endpoint = sys.argv[1]
headers = {
'Host': sys.argv[2]
}
with open('input.json') as file:
sample_file = json.load(file)
inputs = sample_file["instances"]
# Split inputs into chunks of size ... | 832 | 24.242424 | 74 | py |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/server/README.md | # Logistic Regression Model on the German Credit dataset
## Build a development docker image
To build a development image first download these files and move them into the `server/` folder
- https://archive.ics.uci.edu/ml/machine-learning-databases/statlog/german/german.data
- https://archive.ics.uci.edu/ml/machine-l... | 921 | 40.909091 | 179 | md |
kserve | kserve-master/docs/samples/explanation/aif/germancredit/server/model.py | import kserve
from typing import Dict, Union
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from aif360.algorithms.preprocessing.optim_preproc_helpers.data_preproc_functions import load_preproc_data_german
from kserve import InferRequest, InferResponse
from kserve... | 1,538 | 31.744681 | 113 | py |
kserve | kserve-master/docs/samples/explanation/aix/Fetch_20newsgroups/README.md | # Using AIX to get explanations for NewsGroups classifications
This is another explanation example for text compare to [MNIST classifications (for image)](https://github.com/kserve/kserve/tree/master/docs/samples/explanation/aix/mnist).
To deploy the inferenceservice with v1beta1 API
`kubectl apply -f aix-explainer.... | 1,877 | 43.714286 | 262 | md |
kserve | kserve-master/docs/samples/explanation/aix/Fetch_20newsgroups/aix-explainer.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "aix-explainer"
namespace: default
spec:
predictor:
model:
modelFormat:
name: sklearn
storageUri: "gs://kfserving-examples/models/sklearn/newsgroup"
env:
- name: PREDICT_PROBA
value: "t... | 715 | 18.888889 | 68 | yaml |
kserve | kserve-master/docs/samples/explanation/aix/Fetch_20newsgroups/query_explain.py | import sys
import requests
import json
from matplotlib import pyplot as plt
import numpy as np
from sklearn.datasets import fetch_20newsgroups
import time
print('************************************************************')
print('************************************************************')
print('*****************... | 2,516 | 26.064516 | 69 | py |
kserve | kserve-master/docs/samples/explanation/aix/Fetch_20newsgroups/train_rf.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,528 | 24.915254 | 77 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/README.md | # Using AIX to get explanations for MNIST classifications
This is an example of how to explain model predictions using [AI Explainability 360 (AIX360)](https://ai-explainability-360.org/) on KFServing. We will be using mnist dataset for handwritten digits for this model and explain how the model decides the predicted ... | 4,380 | 72.016667 | 586 | md |
kserve | kserve-master/docs/samples/explanation/aix/mnist/aix-explainer.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "aix-explainer"
namespace: default
spec:
predictor:
containers:
- name: predictor
image: aipipeline/rf-predictor:0.4.1
command: ["python", "-m", "rfserver", "--model_name", "aix-explainer"]
imagePullPolicy: ... | 788 | 20.916667 | 76 | yaml |
kserve | kserve-master/docs/samples/explanation/aix/mnist/query_explain.py | import sys
import requests
import json
import math
from matplotlib import pyplot as plt
import numpy as np
from aix360.datasets import MNISTDataset
import time
from skimage.color import gray2rgb, label2rgb # since the code wants color images
print('************************************************************')
print(... | 2,285 | 28.307692 | 82 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/train_rf.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,505 | 25.892857 | 74 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/README.md | # Random Forest for MNIST on kfserving | 38 | 38 | 38 | md |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/rf.Dockerfile | FROM python:3.7
COPY . .
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir kserve
RUN pip install --no-cache-dir -e .
ENTRYPOINT ["python", "-m", "rfserver", "--model_name", "aixserver"]
| 213 | 29.571429 | 81 | Dockerfile |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/setup.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,310 | 31.775 | 80 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/rfserver/__init__.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 613 | 39.933333 | 74 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/rfserver/__main__.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,000 | 32.366667 | 74 | py |
kserve | kserve-master/docs/samples/explanation/aix/mnist/rfserver/rfserver/model.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 2,516 | 30.4625 | 98 | py |
kserve | kserve-master/docs/samples/explanation/alibi/alibi_helper.py | import numpy as np
import requests
import pandas as pd
import plotly.graph_objects as go
from IPython.display import Markdown, display
def getFeatures(X, cmap):
return pd.DataFrame(X).replace(cmap).values.squeeze().tolist()
def predict(X, name, ds, svc_hostname, cluster_ip):
formData = {
'instances'... | 2,536 | 30.320988 | 115 | py |
kserve | kserve-master/docs/samples/explanation/alibi/cifar10/README.md | # CIFAR10 Image Classifier Explanations
Please refer to [Alibi image classfier explainer example](https://kserve.github.io/website/master/modelserving/explainer/alibi/cifar10/) on KServe website for deploying inferenceService with anchor image explainer.
| 256 | 63.25 | 214 | md |
kserve | kserve-master/docs/samples/explanation/alibi/cifar10/cifar10.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "cifar10"
spec:
predictor:
tensorflow:
storageUri: "gs://seldon-models/tfserving/cifar10/resnet32"
resources:
requests:
cpu: 0.1
memory: 5Gi
limits:
... | 671 | 22.172414 | 83 | yaml |
kserve | kserve-master/docs/samples/explanation/alibi/income/README.md | # Example Anchors Tabular Explanation for Income Prediction
Please refer to [Alibi anchors tabular explainer example](https://kserve.github.io/website/master/modelserving/explainer/alibi/income/) on KServe website for deploying inferenceService with anchor tabular explainer.
| 277 | 68.5 | 215 | md |
kserve | kserve-master/docs/samples/explanation/alibi/income/income.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "income"
spec:
predictor:
minReplicas: 1
sklearn:
storageUri: "gs://seldon-models/sklearn/income/model"
resources:
requests:
cpu: 0.1
memory: 1Gi
limits:
cpu: 1
... | 632 | 20.827586 | 85 | yaml |
kserve | kserve-master/docs/samples/explanation/alibi/income/train.py | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 2,809 | 36.466667 | 103 | py |
kserve | kserve-master/docs/samples/explanation/alibi/moviesentiment/README.md | # Example Anchors Text Explanation for Movie Sentiment
Please refer to [moviesentiment explainer example](https://kserve.github.io/website/master/modelserving/explainer/alibi/moviesentiment/) on KServe website repository for deploying inferenceService with anchor text explainer.
| 281 | 69.5 | 224 | md |
kserve | kserve-master/docs/samples/explanation/alibi/moviesentiment/moviesentiment.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "moviesentiment"
spec:
predictor:
minReplicas: 1
sklearn:
storageUri: "gs://seldon-models/v1.16.0/sklearn/moviesentiment"
resources:
requests:
cpu: 0.1
memory: 1Gi ... | 592 | 20.962963 | 69 | yaml |
kserve | kserve-master/docs/samples/explanation/alibi/moviesentiment/moviesentiment2.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "moviesentiment"
spec:
predictor:
sklearn:
storageUri: "gs://seldon-models/v1.16.0/sklearn/moviesentiment"
resources:
requests:
cpu: 0.1
explainer:
alibi:
type: AnchorText
config:
... | 424 | 19.238095 | 69 | yaml |
kserve | kserve-master/docs/samples/explanation/alibi/moviesentiment/train.py | import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from alibi.datasets import fetch_movie_sentiment
from sklearn.pipeline import Pipeline
import... | 1,909 | 33.107143 | 107 | py |
kserve | kserve-master/docs/samples/explanation/art/mnist/README.md | # Using ART to get adversarial examples for MNIST classifications
This is an example to show how adversarially modified inputs can trick models to predict incorrectly to highlight model vulnerability to adversarial attacks. It is using the [Adversarial Robustness Toolbox (ART)](https://adversarial-robustness-toolbox.o... | 4,283 | 76.890909 | 687 | md |
kserve | kserve-master/docs/samples/explanation/art/mnist/art.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "artserver"
spec:
predictor:
model:
modelFormat:
name: sklearn
storageUri: gs://kfserving-examples/models/sklearn/mnist/art
explainer:
art:
type: SquareAttack
config:
nb_classes: "10"
| 319 | 19 | 66 | yaml |
kserve | kserve-master/docs/samples/explanation/art/mnist/query_explain.py | import requests
import json
from matplotlib import pyplot as plt
import numpy as np
from aix360.datasets import MNISTDataset
import time
import sys
if len(sys.argv) < 3:
raise Exception("No endpoint specified. ")
endpoint = sys.argv[1]
headers = {
'Host': sys.argv[2]
}
data = MNISTDataset()
test_num = 349
is_... | 2,045 | 26.648649 | 68 | py |
kserve | kserve-master/docs/samples/explanation/art/mnist/train_model.py |
import warnings
from sklearn.datasets import fetch_openml
from sklearn.exceptions import ConvergenceWarning
from sklearn.neural_network import MLPClassifier
import joblib
# Load data from https://www.openml.org/d/554
X, y = fetch_openml('mnist_784', version=1, return_X_y=True)
X = X / 255.
X_train, X_test = X[:60000... | 998 | 32.3 | 80 | py |
kserve | kserve-master/docs/samples/fluid/README.md | # KServe with Fluid on LLM (Large Language Model) Acceleration
In this example we will show how to use [Fluid](https://github.com/fluid-cloudnative/fluid) to improve autoscaling performance on LLM (Large Language Model) in KServe.
## DISCLAIMER
This Proof of Concept (PoC) is a collaborative effort between KServe and... | 14,827 | 41.97971 | 565 | md |
kserve | kserve-master/docs/samples/fluid/alluxio.yaml | apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
name: s3-data
spec:
mounts:
- mountPoint: "s3://${bucket}/models/bloom-560m/"
name: bloom-560m
path: /bloom-560m
options:
alluxio.underfs.s3.region: "eu-central-1"
alluxio.underfs.s3.secure.http.enabled: "true"
en... | 1,635 | 26.266667 | 106 | yaml |
kserve | kserve-master/docs/samples/fluid/dataload.yaml | apiVersion: data.fluid.io/v1alpha1
kind: DataLoad
metadata:
name: s3-dataload
spec:
dataset:
name: s3-data
namespace: kserve-fluid-demo
target:
# # please update it accordingly
- path: /bloom-560m
# - path: /bloom-7b1
replicas: 2 | 261 | 19.153846 | 36 | yaml |
kserve | kserve-master/docs/samples/fluid/download_model.py | # Copyright 2023, SAP SE or an SAP affiliate company and KServe contributors
import argparse
from pathlib import Path
from huggingface_hub import snapshot_download
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--model_name', default="bigscience/bloom-560m", help='model na... | 1,083 | 40.692308 | 195 | py |
kserve | kserve-master/docs/samples/fluid/fluid-isvc.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "fluid-bloom"
labels:
serverless.fluid.io/inject: "true"
spec:
predictor:
terminationGracePeriodSeconds: 60
timeout: 600
minReplicas: 0
nodeSelector:
node.kubernetes.io/instance-type: m5.4xlarge
containe... | 994 | 28.264706 | 78 | yaml |
kserve | kserve-master/docs/samples/fluid/jindo.yaml | apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
name: s3-data
spec:
mounts:
- mountPoint: "s3://${bucket}/models/bloom-560m/"
name: bloom-560m
path: /bloom-560m
options:
fs.s3.region: "eu-central-1"
fs.s3.endpoint: "s3.eu-central-1.amazonaws.com"
encryptOptions... | 1,652 | 23.671642 | 55 | yaml |
kserve | kserve-master/docs/samples/fluid/kserve-isvc.yaml | apiVersion: "serving.kserve.io/v1beta1"
kind: "InferenceService"
metadata:
name: "kserve-bloom"
spec:
predictor:
terminationGracePeriodSeconds: 60
timeout: 600
minReplicas: 0
serviceAccountName: sa
nodeSelector:
node.kubernetes.io/instance-type: m5.4xlarge
containers:
- name: kse... | 989 | 29 | 78 | yaml |
kserve | kserve-master/docs/samples/fluid/s3creds.yaml | ---
apiVersion: v1
kind: Secret
metadata:
name: s3creds
annotations:
serving.kserve.io/s3-endpoint: "s3.eu-central-1.amazonaws.com"
serving.kserve.io/s3-usehttps: "1"
serving.kserve.io/s3-region: "eu-central-1"
serving.kserve.io/s3-useanoncredential: "false"
type: Opaque
stringData:
AWS_ACCESS... | 455 | 20.714286 | 67 | yaml |
kserve | kserve-master/docs/samples/fluid/docker/models.py | # Copyright 2023, SAP SE or an SAP affiliate company and KServe contributors
import os
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from flask import Flask, request
import logging
from signal import signal, SIGINT
app = Flask(__name__)
logging.basicConfig(level=logging.DEBUG, format='%(... | 2,995 | 30.536842 | 114 | py |