Skip to content

Commit f6c2d2c

Browse files
authored
Merge pull request #241 from pytorch/update_instructions_edit
update instructions as per the latest public repos
2 parents 16cafbf + 2e35197 commit f6c2d2c

File tree

3 files changed

+35
-45
lines changed

3 files changed

+35
-45
lines changed

PyPiDescription.rst

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,16 @@
11
Project Description
22
===================
33

4-
TorchServe (PyTorch mdoel server) is a flexible and easy to use tool for
4+
TorchServe (PyTorch model server) is a flexible and easy to use tool for
55
serving deep learning models exported from `PyTorch <http://pytorch.org/>`__.
66

77
Use the TorchServe CLI, or the pre-configured Docker images, to start a
88
service that sets up HTTP endpoints to handle model inference requests.
99

10-
Prerequisites
11-
-------------
12-
13-
* **java 8**: Required. TorchServe use java to serve HTTP requests. You must install java 8 (or later) and make sure java is on available in $PATH environment variable *before* installing torchserve. If you have multiple java installed, you can use $JAVA_HOME environment vairable to control which java to use.
14-
* **PyTorch**: Required. Latest version of PyTorch will be installed as a part of TorchServe installation.
15-
16-
For ubuntu:
17-
::
18-
19-
sudo apt-get install openjdk-8-jdk
20-
21-
22-
For centos
23-
::
24-
25-
sudo yum install java-1.8.0-openjdk
26-
27-
28-
For Mac:
29-
::
30-
31-
brew tap caskroom/versions
32-
brew update
33-
brew cask install java8
34-
35-
36-
Install PyTorch:
37-
::
38-
39-
pip install torch torchvision torchtext
40-
41-
4210
Installation
4311
------------
4412

45-
::
46-
47-
pip install torchserve
13+
Full installation instructions are in the project repo: https://github.com/pytorch/serve/blob/master/README.md
4814

4915

5016
Source code

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Conda instructions are provided in more detail, but you may also use `pip` and `
2020
To use `pip` to install TorchServe and the model archiver:
2121

2222
```
23+
pip install torch torchtext torchvision sentencepiece
2324
pip install torchserve torch-model-archiver
2425
```
2526

@@ -32,8 +33,13 @@ _Ubuntu_
3233
```
3334
1. Install Conda (https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html)
3435
1. Create an environment and install torchserve and torch-model-archiver
36+
For CPU
3537
```bash
36-
conda create --name torchserve torchserve torch-model-archiver -c pytorch
38+
conda create --name torchserve torchserve torch-model-archiver pytorch torchtext torchvision -c pytorch -c powerai
39+
```
40+
For GPU
41+
```bash
42+
conda create --name torchserve torchserve torch-model-archiver pytorch torchtext torchvision cudatoolkit=10.1 -c pytorch -c powerai
3743
```
3844
1. Activate the environment
3945
```bash
@@ -47,10 +53,10 @@ _macOS_
4753
brew tap AdoptOpenJDK/openjdk
4854
brew cask install adoptopenjdk11
4955
```
50-
1. Install Conda (https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html)
56+
1. Install Conda (https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html)
5157
1. Create an environment and install torchserve and torch-model-archiver
5258
```bash
53-
conda create --name torchserve torchserve torch-model-archiver -c pytorch
59+
conda create --name torchserve torchserve torch-model-archiver pytorch torchtext torchvision -c pytorch -c powerai
5460
```
5561
1. Activate the environment
5662
```bash

docker/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#### Create TorchServe docker image
1+
# Create TorchServe docker image
22

33
```bash
44
cd serve/docker
@@ -7,21 +7,39 @@ git clone https://github.com/pytorch/serve.git
77

88
For creating CPU based image :
99
```bash
10-
docker build --file Dockerfile.cpu -t torchserve:1.0 .
10+
docker build --file Dockerfile.cpu -t torchserve:latest .
1111
```
1212

1313
For creating GPU based image :
1414
```bash
15-
docker build --file Dockerfile.gpu -t torchserve:1.0 .
15+
docker build --file Dockerfile.gpu -t torchserve:latest .
1616
```
1717

18-
#### Start container with TorchServe image
18+
## Start a container with a TorchServe image
1919

20+
The following examples will start the container with 8080/81 port exposed to outer-world/localhost.
21+
22+
### Start CPU container
23+
24+
For specific versions you can pass in the specific tag to use (ex: 0.1-cpu):
2025
```bash
21-
docker run --rm -it -p 8080:8080 -p 8081:8081 torchserve:1.0
26+
docker run --rm -it -p 8080:8080 -p 8081:8081 pytorch/torchserve:0.1-cpu
2227
```
2328

24-
The above command will start the container with 8080/81 port exposed to outer-world/localhost
29+
For the latest version, you can use the `latest` tag:
30+
docker run --rm -it -p 8080:8080 -p 8081:8081 pytorch/torchserve:latest
31+
32+
#### Start GPU container
33+
34+
For specific versions you can pass in the specific tag to use (ex: 0.1-cpu):
35+
```bash
36+
docker run --rm -it --gpus all -p 8080:8080 -p 8081:8081 pytorch/torchserve:0.1-cuda10.1-cudnn7-runtime
37+
```
38+
39+
For the latest version, you can use the `gpu-latest` tag:
40+
```bash
41+
docker run --rm -it --gpus all -p 8080:8080 -p 8081:8081 pytorch/torchserve:latest-gpu
42+
```
2543

2644
#### Accessing TorchServe APIs inside container
2745

0 commit comments

Comments
 (0)