Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bash snippets in Docker.md #2345

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions examples/image_classifier/mnist/Docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ https://github.com/pytorch/examples/tree/master/mnist

Run the commands given in following steps from the parent directory of the root of the repository. For example, if you cloned the repository into /home/my_path/serve, run the steps from /home/my_path/serve

### Create a torch model archive using the torch-model-archiver utility to archive the above files.
### Create a torch model archive using the torch-model-archiver utility to archive the above files.

```bash
torch-model-archiver --model-name mnist --version 1.0 --model-file examples/image_classifier/mnist/mnist.py --serialized-file examples/image_classifier/mnist/mnist_cnn.pt --handler examples/image_classifier/mnist/mnist_handler.py
```
```bash
torch-model-archiver --model-name mnist --version 1.0 --model-file examples/image_classifier/mnist/mnist.py --serialized-file examples/image_classifier/mnist/mnist_cnn.pt --handler examples/image_classifier/mnist/mnist_handler.py
```

### Move .mar file into model_store directory

```bash
mkdir model_store
mv mnist.mar model_store/
```
```bash
mkdir model_store
mv mnist.mar model_store/
```

### Start a docker container with torchserve

Expand All @@ -47,8 +47,8 @@ Run the commands given in following steps from the parent directory of the root

### Run digit recognition inference outside the container

```bash
curl http://127.0.0.1:8080/predictions/mnist -T examples/image_classifier/mnist/test_data/0.png
```
```bash
curl http://127.0.0.1:8080/predictions/mnist -T examples/image_classifier/mnist/test_data/0.png
```

The output in this case will be a `0`
The output in this case will be a `0`
Loading