File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
pkg/workloads/cortex/client Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,16 @@ See [here](../miscellaneous/cli.md#install-cortex-cli-without-python-client) to
1919``` bash
2020# clone the Cortex repository
2121git clone -b master https://github.com/cortexlabs/cortex.git
22+
23+ # navigate to the Pytorch text generator example
24+ cd cortex/examples/pytorch/text-generator
2225```
2326
2427### Using the CLI
2528
2629``` bash
2730# deploy the model as a realtime api
28- cortex deploy cortex/examples/pytorch/text-generator/cortex.yaml
31+ cortex deploy
2932
3033# view the status of the api
3134cortex get --watch
@@ -39,7 +42,7 @@ cortex get text-generator
3942# generate text
4043curl < API endpoint> \
4144 -X POST -H " Content-Type: application/json" \
42- -d ' {"text": "machine learning is"}' \
45+ -d ' {"text": "machine learning is"}'
4346
4447# delete the api
4548cortex delete text-generator
@@ -54,7 +57,7 @@ import requests
5457local_client = cortex.client(" local" )
5558
5659# deploy the model as a realtime api and wait for it to become active
57- deployments = local_client.deploy(" cortex/examples/pytorch/text-generator /cortex.yaml" , wait = True )
60+ deployments = local_client.deploy(" . /cortex.yaml" , wait = True )
5861
5962# get the api's endpoint
6063url = deployments[0 ][" api" ][" endpoint" ]
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ You must have [Docker](https://docs.docker.com/install) installed to run Cortex
3838``` bash
3939# clone the Cortex repository
4040git clone -b master https://github.com/cortexlabs/cortex.git
41+
42+ # navigate to the Pytorch text generator example
43+ cd cortex/examples/pytorch/text-generator
4144```
4245
4346### In Python
@@ -48,7 +51,7 @@ import requests
4851local_client = cortex.client(" local" )
4952
5053# deploy the model as a realtime api and wait for it to become active
51- deployments = local_client.deploy(" cortex/examples/pytorch/text-generator /cortex.yaml" , wait = True )
54+ deployments = local_client.deploy(" . /cortex.yaml" , wait = True )
5255
5356# get the api's endpoint
5457url = deployments[0 ][" api" ][" endpoint" ]
@@ -63,7 +66,7 @@ local_client.delete_api("text-generator")
6366### Using the CLI
6467``` bash
6568# deploy the model as a realtime api
66- cortex deploy cortex/examples/pytorch/text-generator/cortex.yaml
69+ cortex deploy
6770
6871# view the status of the api
6972cortex get --watch
@@ -77,7 +80,7 @@ cortex get text-generator
7780# generate text
7881curl < API endpoint> \
7982 -X POST -H " Content-Type: application/json" \
80- -d ' {"text": "machine learning is"}' \
83+ -d ' {"text": "machine learning is"}'
8184
8285# delete the api
8386cortex delete text-generator
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ def run_cli(
8787 if not hide_output :
8888 if (not mixed_output ) or (mixed_output and not result_found ):
8989 sys .stdout .write (c )
90+ sys .stdout .flush ()
9091
9192 process .wait ()
9293
You can’t perform that action at this time.
0 commit comments