Skip to content

Commit 446c220

Browse files
ospillingerdeliahu
authored andcommitted
Update docs
(cherry picked from commit c7030ff)
1 parent 11bf358 commit 446c220

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Deploy machine learning models in production
22

3-
Cortex is an open source platform that takes machine learning models—trained with nearly any framework—and turns them into production web APIs in one command. <br>
3+
Cortex is an open source platform for deploying machine learning models—trained with nearly any framework—as production web services.
4+
5+
<br>
46

57
<!-- Set header Cache-Control=no-cache on the S3 object metadata (see https://help.github.com/en/articles/about-anonymized-image-urls) -->
68
![Demo](https://d1zqebknpdh033.cloudfront.net/demo/gif/v0.8.gif)
@@ -15,6 +17,8 @@ Cortex is an open source platform that takes machine learning models—trained w
1517

1618
- **CPU / GPU support:** Cortex can run inference on CPU or GPU infrastructure.
1719

20+
- **Spot instances:** Cortex supports EC2 spot instances.
21+
1822
- **Rolling updates:** Cortex updates deployed APIs without any downtime.
1923

2024
- **Log streaming:** Cortex streams logs from deployed models to your CLI.
@@ -27,12 +31,12 @@ Cortex is an open source platform that takes machine learning models—trained w
2731

2832
## Usage
2933

30-
### Define your API
34+
### Implement your predictor
3135

3236
```python
3337
# predictor.py
3438

35-
model = download_my_model()
39+
model = download_model()
3640

3741
def predict(sample, metadata):
3842
return model.predict(sample["text"])
@@ -54,6 +58,7 @@ def predict(sample, metadata):
5458
model_type: classification
5559
compute:
5660
gpu: 1
61+
mem: 4G
5762
```
5863
5964
### Deploy to AWS
@@ -69,7 +74,7 @@ creating classifier (http://***.amazonaws.com/sentiment/classifier)
6974
```bash
7075
$ curl http://***.amazonaws.com/sentiment/classifier \
7176
-X POST -H "Content-Type: application/json" \
72-
-d '{"text": "the movie was great!"}'
77+
-d '{"text": "the movie was amazing!"}'
7378

7479
positive
7580
```
@@ -80,7 +85,7 @@ positive
8085
$ cortex get classifier --watch
8186

8287
status up-to-date available requested last update avg latency
83-
live 1 1 1 8s 123ms
88+
live 1 1 1 8s 24ms
8489

8590
class count
8691
positive 8
@@ -91,7 +96,7 @@ negative 4
9196

9297
## How it works
9398

94-
The CLI sends configuration and code to the cluster every time you run `cortex deploy`. Each model is loaded into a Docker container, along with any Python packages and request handling code. The model is exposed as a web service using Elastic Load Balancing (ELB), Flask, TensorFlow Serving, and ONNX Runtime. The containers are orchestrated on Elastic Kubernetes Service (EKS) while logs and metrics are streamed to CloudWatch.
99+
The CLI sends configuration and code to the cluster every time you run `cortex deploy`. Each model is loaded into a Docker container, along with any Python packages and request handling code. The model is exposed as a web service using Elastic Load Balancing (ELB), TensorFlow Serving, and ONNX Runtime. The containers are orchestrated on Elastic Kubernetes Service (EKS) while logs and metrics are streamed to CloudWatch.
95100

96101
<br>
97102

@@ -101,4 +106,5 @@ The CLI sends configuration and code to the cluster every time you run `cortex d
101106
- [Sentiment analysis](https://github.com/cortexlabs/cortex/tree/0.11/examples/tensorflow/sentiment-analysis) in TensorFlow with BERT
102107
- [Image classification](https://github.com/cortexlabs/cortex/tree/0.11/examples/tensorflow/image-classifier) in TensorFlow with Inception
103108
- [Text generation](https://github.com/cortexlabs/cortex/tree/0.11/examples/pytorch/text-generator) in PyTorch with DistilGPT2
104-
- [Iris classification](https://github.com/cortexlabs/cortex/tree/0.11/examples/xgboost/iris-classifier) in XGBoost / ONNX
109+
- [Reading comprehension](https://github.com/cortexlabs/cortex/tree/0.11/examples/pytorch/text-generator) in PyTorch with ELMo-BiDAF
110+
- [Iris classification](https://github.com/cortexlabs/cortex/tree/0.11/examples/sklearn/iris-classifier) in scikit-learn

docs/cluster/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Note: This will create resources in your AWS account which aren't included in th
2929
git clone -b 0.11 https://github.com/cortexlabs/cortex.git
3030

3131
# Navigate to the iris classifier example
32-
cd cortex/examples/tensorflow/iris-classifier
32+
cd cortex/examples/sklearn/iris-classifier
3333

3434
# Deploy the model to the cluster
3535
cortex deploy

examples/sklearn/iris-classifier/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ python3 trainer.py
4848

4949
<br>
5050

51-
## Define a predictor
51+
## Implement a predictor
5252

5353
1. Create another Python file `predictor.py`.
5454
2. Add code to load and initialize your pickled model.
@@ -100,7 +100,7 @@ You can skip dependencies that are [pre-installed](../../../docs/deployments/pre
100100

101101
<br>
102102

103-
## Define a deployment
103+
## Configure a deployment
104104

105105
Create a `cortex.yaml` file and add the configuration below. A `deployment` specifies a set of resources that are deployed together. An `api` provides a runtime for inference and makes our `predictor.py` implementation available as a web service that can serve real-time predictions:
106106

@@ -158,7 +158,7 @@ $ curl http://***.amazonaws.com/iris/classifier \
158158

159159
<br>
160160

161-
## Add prediction tracking
161+
## Configure prediction tracking
162162

163163
Add a `tracker` to your `cortex.yaml` and specify that this is a classification model:
164164

0 commit comments

Comments
 (0)