mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
* feat: Support customizable deployment strategy for RawDeployment mode Signed-off-by: Yuan Tang <[email protected]> * regen Signed-off-by: Yuan Tang <[email protected]> * lint Signed-off-by: Yuan Tang <[email protected]> * Correctly apply rollingupdate Signed-off-by: Yuan Tang <[email protected]> * address comments Signed-off-by: Yuan Tang <[email protected]> * Add validation Signed-off-by: Yuan Tang <[email protected]> --------- Signed-off-by: Yuan Tang <[email protected]>
6.2 KiB
6.2 KiB
In [ ]:
!pygmentize moviesentiment.yamlIn [ ]:
!kubectl apply -f moviesentiment.yamlIn [ ]:
CLUSTER_IPS = !(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
CLUSTER_IP = CLUSTER_IPS[0]
print(CLUSTER_IP)In [ ]:
SERVICE_HOSTNAMES = !(kubectl get inferenceservice moviesentiment -o jsonpath='{.status.url}' | cut -d "/" -f 3)
SERVICE_HOSTNAME = SERVICE_HOSTNAMES[0]
print(SERVICE_HOSTNAME)In [ ]:
import sys
sys.path.append("../")
from alibi_helper import *In [ ]:
from alibi.datasets import fetch_movie_sentiment
movies = fetch_movie_sentiment()In [ ]:
idxNeg = 37
idxPos = 5227
for idx in [idxNeg, idxPos]:
print(movies.data[idx])
show_prediction(
predict(
movies.data[idx : idx + 1],
"moviesentiment",
movies,
SERVICE_HOSTNAME,
CLUSTER_IP,
)
)In [ ]:
exp = explain(
movies.data[idxNeg : idxNeg + 1], "moviesentiment", SERVICE_HOSTNAME, CLUSTER_IP
)In [ ]:
show_anchors(exp["data"]["anchor"])In [ ]:
show_bar([exp["data"]["precision"]], [""], "Precision")
show_bar([exp["data"]["coverage"]], [""], "Coverage")In [ ]:
show_feature_coverage(exp["data"])In [ ]:
show_examples(exp["data"], 0, movies)In [ ]:
show_examples(exp["data"], 0, movies, False)In [ ]:
exp = explain(
movies.data[idxPos : idxPos + 1], "moviesentiment", SERVICE_HOSTNAME, CLUSTER_IP
)In [ ]:
show_anchors(exp["data"]["anchor"])In [ ]:
show_bar([exp["data"]["precision"]], [""], "Precision")
show_bar([exp["data"]["coverage"]], [""], "Coverage")In [ ]:
show_feature_coverage(exp["data"])In [ ]:
show_examples(exp["data"], 0, movies)In [ ]:
show_examples(exp["data"], 0, movies, False)In [ ]:
!kubectl delete -f moviesentiment.yamlIn [ ]: