File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM tensorflow/tensorflow:1.12.0-py3
2
+
3
+ ENV LANG=C.UTF-8
4
+ RUN mkdir /gpt-2
5
+ WORKDIR /gpt-2
6
+ COPY requirements.txt download_model.sh /gpt-2/
7
+ RUN apt-get update && \
8
+ apt-get install -y curl && \
9
+ sh download_model.sh 117M
10
+ RUN pip3 install -r requirements.txt
11
+
12
+ ADD . /gpt-2
Original file line number Diff line number Diff line change
1
+ FROM tensorflow/tensorflow:1.12.0-gpu-py3
2
+
3
+ # nvidia-docker 1.0
4
+ LABEL com.nvidia.volumes.needed="nvidia_driver"
5
+ LABEL com.nvidia.cuda.version="${CUDA_VERSION}"
6
+
7
+ # nvidia-container-runtime
8
+ ENV NVIDIA_VISIBLE_DEVICES=all \
9
+ NVIDIA_DRIVER_CAPABILITIES=compute,utility \
10
+ NVIDIA_REQUIRE_CUDA="cuda>=8.0" \
11
+ LANG=C.UTF-8
12
+
13
+ RUN mkdir /gpt-2
14
+ WORKDIR /gpt-2
15
+ COPY requirements.txt download_model.sh /gpt-2/
16
+ RUN apt-get update && \
17
+ apt-get install -y curl && \
18
+ sh download_model.sh 117M
19
+ RUN pip3 install -r requirements.txt
20
+
21
+ ADD . /gpt-2
Original file line number Diff line number Diff line change @@ -34,6 +34,21 @@ Install other python packages:
34
34
pip3 install -r requirements.txt
35
35
```
36
36
37
+ ## Docker Installation
38
+
39
+ Build the Dockerfile and tag the created image as ` gpt-2 ` :
40
+ ```
41
+ docker build --tag gpt-2 -f Dockerfile.gpu . # or Dockerfile.cpu
42
+ ```
43
+
44
+ Start an interactive bash session from the ` gpt-2 ` docker image.
45
+
46
+ You can opt to use the ` --runtime=nvidia ` flag if you have access to a NVIDIA GPU
47
+ and a valid install of [ nvidia-docker 2.0] ( https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0) ) .
48
+ ```
49
+ docker run --runtime=nvidia -it gpt-2 bash
50
+ ```
51
+
37
52
## Usage
38
53
39
54
| WARNING: Samples are unfiltered and may contain offensive content. |
You can’t perform that action at this time.
0 commit comments