Skip to content

Commit 553b0cd

Browse files
committed
Update README.md
1 parent 41c83ec commit 553b0cd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Cortex is an open source platform for deploying, managing, and scaling machine l
1818

1919
region: us-east-1
2020
instance_type: g4dn.xlarge
21-
spot: true
2221
min_instances: 10
2322
max_instances: 100
23+
spot: true
2424
```
2525
2626
#### Spin up Cortex on your AWS account
@@ -47,6 +47,8 @@ cortex is ready!
4747
#### Implement a predictor
4848

4949
```python
50+
# predictor.py
51+
5052
from transformers import pipeline
5153

5254
class PythonPredictor:
@@ -63,6 +65,10 @@ class PythonPredictor:
6365
api_spec = {
6466
"name": "text-generator",
6567
"kind": "RealtimeAPI",
68+
"predictor": {
69+
"type": "python",
70+
"path": "predictor.py"
71+
},
6672
"compute": {
6773
"gpu": 1,
6874
"mem": "8Gi",
@@ -92,8 +98,8 @@ api_spec = {
9298
```python
9399
import cortex
94100

95-
cx = cortex.client()
96-
cx.deploy(api_spec, predictor=PythonPredictor)
101+
cx = cortex.client("aws")
102+
cx.deploy(api_spec, project_dir=".")
97103

98104
# creating https://example.com/text-generator
99105
```

0 commit comments

Comments
 (0)