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: examples/sentiment-analysis/README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This example shows how to deploy a sentiment analysis classifier trained using [
4
4
5
5
## Define a deployment
6
6
7
-
A `deployment` specifies a set of resources that are deployed as a single unit. An `api` makes a model available as a web service that can serve real-time predictions. This configuration will download the model from the `cortex-examples` S3 bucket and preprocess the payload and postprocess the inference with functions defined in `sentiment.py`.
7
+
A `deployment` specifies a set of resources that are deployed as a single unit. An `api` makes a model available as a web service that can serve real-time predictions. This configuration will download the model from the `cortex-examples` S3 bucket and preprocess the payload and postprocess the inference with functions defined in `handler.py`.
8
8
9
9
```yaml
10
10
- kind: deployment
@@ -13,8 +13,11 @@ A `deployment` specifies a set of resources that are deployed as a single unit.
You can run the code that generated the exported BERT model [here](https://colab.research.google.com/github/cortexlabs/cortex/blob/master/examples/sentiment-analysis/bert.ipynb).
20
23
@@ -74,11 +77,11 @@ The output above indicates that one replica of the API was requested and one rep
Copy file name to clipboardExpand all lines: examples/text-generator/README.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This example shows how to deploy OpenAI's GPT-2 model as a service on AWS.
4
4
5
5
## Define a deployment
6
6
7
-
A `deployment` specifies a set of resources that are deployed as a single unit. An `api` makes a model available as a web service that can serve real-time predictions. This configuration will download the 124M GPT-2 model from the `cortex-examples` S3 bucket, preprocess the payload and postprocess the inference with functions defined in `encoder.py` and deploy each replica of the API on 1 GPU.
7
+
A `deployment` specifies a set of resources that are deployed as a single unit. An `api` makes a model available as a web service that can serve real-time predictions. This configuration will download the 124M GPT-2 model from the `cortex-examples` S3 bucket, preprocess the payload and postprocess the inference with functions defined in `handler.py` and deploy each replica of the API on 1 GPU.
8
8
9
9
```yaml
10
10
- kind: deployment
@@ -13,16 +13,18 @@ A `deployment` specifies a set of resources that are deployed as a single unit.
You can run the code that generated the exported GPT-2 model [here](https://colab.research.google.com/github/cortexlabs/cortex/blob/master/examples/text-generator/gpt-2.ipynb).
22
24
23
25
## Add request handling
24
26
25
-
The model requires encoded data for inference, but the API should accept strings of natural language as input. It should also decode the model’s prediction before responding to the client. This can be implemented in a request handler file using the pre_inference and post_inference functions. See [encoder.py](encoder.py) for the complete code.
27
+
The model requires encoded data for inference, but the API should accept strings of natural language as input. It should also decode the model’s prediction before responding to the client. This can be implemented in a request handler file using the pre_inference and post_inference functions.
26
28
27
29
```python
28
30
from encoder import get_encoder
@@ -66,6 +68,10 @@ The output above indicates that one replica of the API was requested and one rep
0 commit comments