Skip to content

Commit 4b721f4

Browse files
committed
Update README.md with instructions for Docker
1 parent d316da8 commit 4b721f4

File tree

2 files changed

+44
-15
lines changed

2 files changed

+44
-15
lines changed

README.md

+44-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,53 @@
1-
# Text Generation Webui (Podman)
1+
# Text Generation Webui (Podman+Docker)
22

3-
This repository puts [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui ) into a podman container. For full usage information, see the README.md in that repository [and the wiki](https://github.com/oobabooga/text-generation-webui/wiki).
3+
This repository puts [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui ) into a container. For full usage information, see the README.md in that repository [and the wiki](https://github.com/oobabooga/text-generation-webui/wiki).
44

5-
This docker file automatically builds GPTQ-for-LLaMa so you can use 4bit LLaMa models.
5+
This Containerfile automatically builds GPTQ-for-LLaMa so you can use 4bit LLaMa models.
66

7-
## Usage
7+
## Prerequisites
88

9-
`./build.sh` to pull the latest commit and build (script provides access to access GPU when building .whl for 4bit)
9+
A working install of `nvidia-container-runtime`
10+
11+
For Fedora, see: [How to enable NVIDIA GPUs in containers on bare metal in RHEL 8](https://www.redhat.com/en/blog/how-use-gpus-containers-bare-metal-rhel-8)
12+
13+
A working install of `podman` or `docker`
14+
15+
A working install of `podman-compose` or `docker-compose-plugin`
16+
17+
## Podman Usage
18+
19+
`podman-compose build` to pull the latest commit and build.
1020

1121
`podman-compose up` to run the container, by default on port 7861.
1222

23+
## Docker Usage
24+
25+
`./docker.sh` will convert the Containerfile into a valid Dockerfile by removing some selinux labels (see that file for more details)
26+
27+
`docker compose -f podman-compose.yaml build` will pull the latest commit and build using the new modified Dockerfile from the last step.
28+
29+
`docker compose -f podman-compose.yaml up` will run the container.
30+
31+
**Gotchas:**
32+
33+
You will also likely need to set the default runtime. Create the following file:
34+
35+
`cat /etc/docker/daemon.json`
36+
37+
```json
38+
{
39+
"runtimes": {
40+
"nvidia": {
41+
"path": "nvidia-container-runtime",
42+
"runtimeArgs": []
43+
}
44+
},
45+
"default-runtime": "nvidia"
46+
}
47+
```
48+
49+
Additionally, If your machine is using `selinux`, you may need to run in privileged by setting `privileged: true` in the `podman-compose.yaml` file. This may have security ramifications beyond the scope of this setup. If you use selinux, I highly suggest running rootless with podman instead.
50+
1351
## Data
1452

1553
`./data` and `./output` will automatically be populated with files and directories from text-generation-webui. Files are set to copy once, then never copy again if they exist. If your models are on a different drive altogether, you can still add additional mount-points, like so:
@@ -23,15 +61,8 @@ volumes:
2361
2462
## Notes
2563
26-
The command line arguments can be changed by modifying `CLI_ARGS` in the podman-compose.yaml file
64+
The command line arguments can be changed by modifying `CLI_ARGS` in the `podman-compose.yaml` file
2765

2866
## License
2967

3068
The license in this repository only applies to the files here, not the original work at [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui). With that said:
31-
32-
```
33-
Copyright © 2023 AJ Walter <[email protected]>
34-
This work is free. You can redistribute it and/or modify it under the
35-
terms of the Do What The Fuck You Want To Public License, Version 2,
36-
as published by Sam Hocevar. See the LICENSE file for more details.
37-
```

docker.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
#!/bin/bash
22
# Docker does not support ,Z selinux labels, so remove them
33
sed 's/\/root\/\.cache\/pip,Z/\/root\/\.cache\/pip/g' Containerfile > Dockerfile
4-
# Use podman-compose.yaml as-is
5-
docker compose -f podman-compose.yaml build

0 commit comments

Comments
 (0)