You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-60Lines changed: 25 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
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>
4
4
5
5
<!-- Set header Cache-Control=no-cache on the S3 object metadata (see https://help.github.com/en/articles/about-anonymized-image-urls) -->
@@ -25,108 +25,73 @@ Cortex is an open source platform that takes machine learning models—trained w
25
25
26
26
<br>
27
27
28
-
## Quickstart
28
+
## Usage
29
29
30
-
Below, we'll walk through how to use Cortex to deploy OpenAI's GPT-2 model as a service on AWS. You'll need to [install Cortex](https://www.cortex.dev/install) on your AWS account before getting started.
30
+
### Step 1: define your API
31
31
32
-
<br>
32
+
```python
33
+
# predictor.py
33
34
34
-
### Step 1: Define your deployment
35
+
model = download_my_model()
36
+
37
+
defpredict(sample, metadata):
38
+
return model.predict(sample["text"])
39
+
```
35
40
36
-
The configuration below will download the model from the `cortex-examples` S3 bucket and deploy it as a web service that can serve real-time predictions.
You can run the code that generated the model [here](https://colab.research.google.com/github/cortexlabs/cortex/blob/0.10/examples/tensorflow/text-generator/gpt-2.ipynb).
55
-
56
-
<br>
57
-
58
-
### Step 2: Add request handling
59
-
60
-
The model requires encoded data for inference, but the API should accept strings of natural language as input. It should also decode the inference output as human-readable text.
Machine learning, with more than one thousand researchers around the world today, are looking to create computer-driven machine learning algorithms that can also be applied to human and social problems, such as education, health care, employment, medicine, politics, or the environment...
80
+
positive
114
81
```
115
82
116
-
Any questions? [chat with us](https://gitter.im/cortexlabs/cortex).
117
-
118
83
<br>
119
84
120
85
## How Cortex works
121
86
122
-
The CLI sends configuration and code to the cluster every time you run `cortex deploy`. Each model is loaded from S3 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.
87
+
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.
123
88
124
89
<br>
125
90
126
91
## More examples
127
92
128
93
<!-- CORTEX_VERSION_README_MINOR x4 -->
129
94
-[Sentiment analysis](https://github.com/cortexlabs/cortex/tree/0.10/examples/tensorflow/sentiment-analysis) in TensorFlow with BERT
130
-
- [Image classification](https://github.com/cortexlabs/cortex/tree/0.10/examples/tensorflow/image-classifier) in TensorFlow with Inception v3
131
-
- [Text Generation](https://github.com/cortexlabs/cortex/tree/0.10/examples/pytorch/text-generator) in PyTorch with Hugging Face's DistilGPT2
95
+
-[Image classification](https://github.com/cortexlabs/cortex/tree/0.10/examples/tensorflow/image-classifier) in TensorFlow with Inception
96
+
-[Text generation](https://github.com/cortexlabs/cortex/tree/0.10/examples/pytorch/text-generator) in PyTorch with DistilGPT2
132
97
-[Iris classification](https://github.com/cortexlabs/cortex/tree/0.10/examples/xgboost/iris-classifier) in XGBoost / ONNX
0 commit comments