Skip to content

Commit 8260d72

Browse files
committed
Update example model export directories
1 parent 14cc784 commit 8260d72

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

examples/sentiment-analysis/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This example shows how to deploy a sentiment analysis classifier trained using [
1010

1111
- kind: api
1212
name: classifier
13-
model: s3://cortex-examples/sentiment
13+
model: s3://cortex-examples/sentiment-analysis/bert
1414
request_handler: sentiment.py
1515
```
1616

examples/sentiment-analysis/bert.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@
933933
"source": [
934934
"AWS_ACCESS_KEY_ID = \"\" #@param {type:\"string\"}\n",
935935
"AWS_SECRET_ACCESS_KEY = \"\" #@param {type:\"string\"}\n",
936-
"S3_UPLOAD_PATH = \"s3://my-bucket/bert\" #@param {type:\"string\"}\n",
936+
"S3_UPLOAD_PATH = \"s3://my-bucket/sentiment-analysis/bert\" #@param {type:\"string\"}\n",
937937
"\n",
938938
"import sys\n",
939939
"import re\n",

examples/sentiment-analysis/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- kind: api
55
name: classifier
6-
model: s3://cortex-examples/bert
6+
model: s3://cortex-examples/sentiment-analysis/bert
77
request_handler: handler.py
88
tracker:
99
model_type: classification

examples/text-generator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ This example shows how to deploy OpenAI's GPT-2 model as a service on AWS.
1010

1111
- kind: api
1212
name: generator
13-
model: s3://cortex-examples/gpt-2/774
13+
model: s3://cortex-examples/text-generator/gpt-2/124M
1414
request_handler: encoder.py
1515
compute:
1616
gpu: 1
1717
```
1818
19-
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 774M 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.
19+
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.
2020

2121
## Add request handling
2222

examples/text-generator/cortex.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- kind: api
55
name: generator
6-
model: s3://cortex-examples/gpt-2/124M
6+
model: s3://cortex-examples/text-generator/gpt-2/124M
77
request_handler: handler.py
88
compute:
99
gpu: 1

examples/text-generator/encoder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ def decode(self, tokens):
105105

106106
def get_encoder():
107107
s3 = boto3.client("s3")
108-
encoder = json.load(s3.get_object(Bucket="cortex-examples", Key="gpt-2/encoder.json")["Body"])
108+
encoder = json.load(
109+
s3.get_object(Bucket="cortex-examples", Key="text-generator/gpt-2/encoder.json")["Body"]
110+
)
109111
bpe_data = (
110-
s3.get_object(Bucket="cortex-examples", Key="gpt-2/vocab.bpe")["Body"]
112+
s3.get_object(Bucket="cortex-examples", Key="text-generator/gpt-2/vocab.bpe")["Body"]
111113
.read()
112114
.decode("utf-8")
113115
)

examples/text-generator/gpt-2.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"source": [
280280
"AWS_ACCESS_KEY_ID = \"\" #@param {type:\"string\"}\n",
281281
"AWS_SECRET_ACCESS_KEY = \"\" #@param {type:\"string\"}\n",
282-
"S3_UPLOAD_PATH = \"s3://my-bucket/gpt-2\" #@param {type:\"string\"}\n",
282+
"S3_UPLOAD_PATH = \"s3://my-bucket/text-generator/gpt-2\" #@param {type:\"string\"}\n",
283283
"\n",
284284
"import sys\n",
285285
"import re\n",

0 commit comments

Comments
 (0)