Delete README.md
Browse files
README.md
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
# CogVideo demo
|
2 |
-
This is an unofficial demo app for [CogVideo](https://github.com/THUDM/CogVideo).
|
3 |
-
|
4 |
-
You can try web demo: [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/THUDM/CogVideo) (This version currently supports only the first stage.)
|
5 |
-
|
6 |
-
https://user-images.githubusercontent.com/25161192/180413610-63f2b76b-684f-404b-9d13-6c0033987b1f.mp4
|
7 |
-
|
8 |
-
https://user-images.githubusercontent.com/25161192/180413654-20ce822f-be7d-40cb-aff3-1712a7505a2c.mp4
|
9 |
-
|
10 |
-
It takes about 7 minutes to load models on startup and about 11 minutes to generate one video.
|
11 |
-
|
12 |
-
## Prerequisite
|
13 |
-
An A100 instance is required to run CogVideo.
|
14 |
-
|
15 |
-
## Installation
|
16 |
-
### Change default-runtime of docker
|
17 |
-
First, put `"default-runtime": "nvidia"` in `/etc/docker/daemon.json`.
|
18 |
-
See: https://github.com/NVIDIA/nvidia-docker/issues/1033#issuecomment-519946473
|
19 |
-
```json
|
20 |
-
{
|
21 |
-
"runtimes": {
|
22 |
-
"nvidia": {
|
23 |
-
"path": "/usr/bin/nvidia-container-runtime",
|
24 |
-
"runtimeArgs": []
|
25 |
-
}
|
26 |
-
},
|
27 |
-
"default-runtime": "nvidia"
|
28 |
-
}
|
29 |
-
```
|
30 |
-
|
31 |
-
Then, restart docker.
|
32 |
-
```bash
|
33 |
-
sudo systemctl restart docker
|
34 |
-
```
|
35 |
-
|
36 |
-
### Clone this repo
|
37 |
-
```bash
|
38 |
-
git clone --recursive https://github.com/hysts/CogVideo_demo
|
39 |
-
cd CogVideo_demo
|
40 |
-
```
|
41 |
-
|
42 |
-
### Build docker image
|
43 |
-
```bash
|
44 |
-
docker build . -t cogvideo
|
45 |
-
```
|
46 |
-
|
47 |
-
### Apply patch to CogVideo repo
|
48 |
-
```bash
|
49 |
-
cd CogVideo
|
50 |
-
patch -p1 < ../patch
|
51 |
-
```
|
52 |
-
|
53 |
-
### Download pretrained models (Optional)
|
54 |
-
The pretrained models will be downloaded automatically on the first run,
|
55 |
-
but it may take quite some time.
|
56 |
-
So you may want to download them in advance.
|
57 |
-
|
58 |
-
This repo assumes the pretrained models are stored in the `pretrained` directory as follows:
|
59 |
-
```
|
60 |
-
pretrained
|
61 |
-
βββ cogvideo-stage1
|
62 |
-
β βββ 27000
|
63 |
-
β β βββ mp_rank_00_model_states.pt
|
64 |
-
β βββ latest
|
65 |
-
β βββ model_config.json
|
66 |
-
βββ cogvideo-stage2
|
67 |
-
β βββ 38000
|
68 |
-
β β βββ mp_rank_00_model_states.pt
|
69 |
-
β βββ latest
|
70 |
-
β βββ model_config.json
|
71 |
-
βββ cogview2-dsr
|
72 |
-
βββ 20000
|
73 |
-
β βββ mp_rank_00_model_states.pt
|
74 |
-
βββ latest
|
75 |
-
βββ model_config.json
|
76 |
-
```
|
77 |
-
|
78 |
-
## Run
|
79 |
-
You can run the app with the following command:
|
80 |
-
```bash
|
81 |
-
docker compose run --rm app
|
82 |
-
```
|
83 |
-
|
84 |
-
The app will start up on port 7860 by default.
|
85 |
-
You can change the port using `GRADIO_SERVER_PORT` environment variable.
|
86 |
-
Use port forwarding when running on GCP, etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|