Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
truskovskiyk committed Sep 19, 2024
1 parent 78636c6 commit 9c7a046
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions module-5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ CMD [ "bash" ]
FROM base AS app-streamlit
CMD streamlit run --server.address 0.0.0.0 --server.port 8080 serving/ui_app.py


# Fast API docker image
FROM base AS app-fastapi
CMD uvicorn --host 0.0.0.0 --port 8080 --workers 4 serving.fast_api:app

FROM base AS app-pytriton
CMD python serving/pytriton_serving.py


FROM base AS app-kserve
ENTRYPOINT ["python", "serving/kserve_api.py"]
8 changes: 7 additions & 1 deletion module-5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Deploy custom model
kubectl create -f ./k8s/kserve-inferenceserver.yaml
```

Port forward via istio

```
kubectl port-forward --namespace istio-system svc/istio-ingressgateway 8080:80
```

Call API

```
Expand Down Expand Up @@ -149,7 +155,7 @@ Deploy
Run K8S with GPUs

```
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb
minikube start --driver docker --container-runtime docker --gpus all
```
Expand Down
2 changes: 1 addition & 1 deletion module-5/k8s/app-streamlit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Deployment
metadata:
name: app-streamlit
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: app-streamlit
Expand Down
3 changes: 0 additions & 3 deletions module-5/serving/kserve_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
from serving.predictor import Predictor
from typing import Dict
from kserve import Model, ModelServer
Expand All @@ -17,8 +16,6 @@ def load(self):
def predict(self, payload: Dict, headers: Dict[str, str] = None) -> Dict:
print(payload)
print(type(payload))
# json_payload = json.loads(payload.decode("utf-8"))
# instances = json_payload["instances"]
instances = payload["instances"]
predictions = self.predictor.predict(instances)
return {"predictions": predictions.tolist()}
Expand Down
1 change: 0 additions & 1 deletion module-5/serving/pytriton_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import numpy as np
from pytriton.client import ModelClient

Expand Down

0 comments on commit 9c7a046

Please sign in to comment.