Cozzy23 commited on
Commit
caa588a
·
verified ·
1 Parent(s): f602b7b

Delete docker

Browse files
docker/Dockerfile-cu121 DELETED
@@ -1,79 +0,0 @@
1
- ARG CUDA_VERSION=12.1.0
2
- ARG from=nvidia/cuda:${CUDA_VERSION}-cudnn8-devel-ubuntu20.04
3
-
4
- FROM ${from} as base
5
-
6
- RUN <<EOF
7
- apt update -y && apt upgrade -y && apt install -y --no-install-recommends \
8
- git \
9
- git-lfs \
10
- python3 \
11
- python3-pip \
12
- python3-dev \
13
- wget \
14
- vim \
15
- && rm -rf /var/lib/apt/lists/*
16
- EOF
17
-
18
- RUN ln -s /usr/bin/python3 /usr/bin/python
19
-
20
- RUN git lfs install
21
-
22
- FROM base as dev
23
-
24
- WORKDIR /
25
-
26
- RUN mkdir -p /data/shared/C9-AI
27
-
28
- WORKDIR /data/shared/C9-AI/
29
-
30
- FROM dev as bundle_req
31
- RUN pip install --no-cache-dir networkx==3.1
32
- RUN pip3 install --no-cache-dir torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cu121
33
- RUN pip3 install --no-cache-dir transformers==4.40.2 accelerate tiktoken einops scipy
34
-
35
- FROM bundle_req as bundle_finetune
36
- ARG BUNDLE_FINETUNE=true
37
-
38
- RUN <<EOF
39
- if [ "$BUNDLE_FINETUNE" = "true" ]; then
40
- cd /data/shared/C9-AI
41
-
42
- # Full-finetune / LoRA.
43
- pip3 install --no-cache-dir "deepspeed==0.14.2" "peft==0.11.1"
44
-
45
- # Q-LoRA.
46
- apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
47
- libopenmpi-dev openmpi-bin \
48
- && rm -rf /var/lib/apt/lists/*
49
- pip3 install --no-cache-dir "optimum==1.20.0" "auto-gptq==0.7.1" "autoawq==0.2.5" mpi4py
50
- fi
51
- EOF
52
-
53
- FROM bundle_finetune as bundle_vllm
54
- ARG BUNDLE_VLLM=true
55
-
56
- RUN <<EOF
57
- if [ "$BUNDLE_VLLM" = "true" ]; then
58
- cd /data/shared/C9-AI
59
-
60
- pip3 install --no-cache-dir vllm==0.4.3 "fschat[model_worker,webui]==0.2.36"
61
- fi
62
- EOF
63
-
64
- FROM bundle_vllm as bundle_flash_attention
65
- ARG BUNDLE_FLASH_ATTENTION=true
66
-
67
- RUN <<EOF
68
- if [ "$BUNDLE_FLASH_ATTENTION" = "true" ]; then
69
- pip3 install --no-cache-dir flash-attn==2.5.8 --no-build-isolation
70
- fi
71
- EOF
72
-
73
- FROM bundle_flash_attention as final
74
-
75
- COPY ../examples/sft/* ./
76
- COPY ../examples/demo/* ./
77
-
78
- # Hugging Face Spaces and many web UIs expect services to listen on 7860.
79
- EXPOSE 7860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docker/docker_cli_demo.sh DELETED
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # This script will automatically pull docker image from DockerHub, and start a container to run the C9-AI cli-demo.
4
-
5
- IMAGE_NAME=c9ai/c9-ai:latest-cu121
6
- C9AI_CHECKPOINT_PATH=/path/to/C9-AI-Instruct
7
- CONTAINER_NAME=c9ai
8
-
9
- function usage() {
10
- echo '
11
- Usage: bash docker/docker_cli_demo.sh [-i IMAGE_NAME] -c [/path/to/C9-AI-Instruct] [-n CONTAINER_NAME]
12
- '
13
- }
14
-
15
- while [[ "$1" != "" ]]; do
16
- case $1 in
17
- -i | --image-name )
18
- shift
19
- IMAGE_NAME=$1
20
- ;;
21
- -c | --checkpoint )
22
- shift
23
- QWEN_CHECKPOINT_PATH=$1
24
- ;;
25
- -n | --container-name )
26
- shift
27
- CONTAINER_NAME=$1
28
- ;;
29
- -h | --help )
30
- usage
31
- exit 0
32
- ;;
33
- * )
34
- echo "Unknown argument ${1}"
35
- exit 1
36
- ;;
37
- esac
38
- shift
39
- done
40
-
41
- if [ ! -e ${C9AI_CHECKPOINT_PATH}/config.json ]; then
42
- echo "Checkpoint config.json file not found in ${C9AI_CHECKPOINT_PATH}, exit."
43
- exit 1
44
- fi
45
-
46
- sudo docker pull ${IMAGE_NAME} || {
47
- echo "Pulling image ${IMAGE_NAME} failed, exit."
48
- exit 1
49
- }
50
-
51
- sudo docker run --gpus all --rm --name ${CONTAINER_NAME} \
52
- --mount type=bind,source=${C9AI_CHECKPOINT_PATH},target=/data/shared/C9-AI/C9-AI-Instruct \
53
- -it ${IMAGE_NAME} \
54
- python cli_demo.py -c /data/shared/C9-AI/C9-AI-Instruct/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docker/docker_web_demo.sh DELETED
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # This script will automatically pull docker image from DockerHub, and start a daemon container to run the C9-AI web-demo.
4
-
5
- IMAGE_NAME=c9ai/c9-ai:latest-cu121
6
- C9AI_CHECKPOINT_PATH=/path/to/C9-AI-Instruct
7
- # Default external port; container listens on 7860
8
- PORT=7860
9
- CONTAINER_NAME=c9ai
10
-
11
- function usage() {
12
- echo '
13
- Usage: bash docker/docker_web_demo.sh [-i IMAGE_NAME] -c [/path/to/C9-AI-Instruct] [-n CONTAINER_NAME] [--port PORT]
14
- '
15
- }
16
-
17
- while [[ "$1" != "" ]]; do
18
- case $1 in
19
- -i | --image-name )
20
- shift
21
- IMAGE_NAME=$1
22
- ;;
23
- -c | --checkpoint )
24
- shift
25
- C9AI_CHECKPOINT_PATH=$1
26
- ;;
27
- -n | --container-name )
28
- shift
29
- CONTAINER_NAME=$1
30
- ;;
31
- --port )
32
- shift
33
- PORT=$1
34
- ;;
35
- -h | --help )
36
- usage
37
- exit 0
38
- ;;
39
- * )
40
- echo "Unknown argument ${1}"
41
- exit 1
42
- ;;
43
- esac
44
- shift
45
- done
46
-
47
- if [ ! -e ${C9AI_CHECKPOINT_PATH}/config.json ]; then
48
- echo "Checkpoint config.json file not found in ${C9AI_CHECKPOINT_PATH}, exit."
49
- exit 1
50
- fi
51
-
52
- sudo docker pull ${IMAGE_NAME} || {
53
- echo "Pulling image ${IMAGE_NAME} failed, exit."
54
- exit 1
55
- }
56
-
57
- sudo docker run --gpus all -d --restart always --name ${CONTAINER_NAME} \
58
- -v /var/run/docker.sock:/var/run/docker.sock -p ${PORT}:7860 \
59
- --mount type=bind,source=${C9AI_CHECKPOINT_PATH},target=/data/shared/C9-AI/C9-AI-Instruct \
60
- -it ${IMAGE_NAME} \
61
- python web_demo.py --server-port 7860 --server-name 0.0.0.0 -c /data/shared/C9-AI/C9-AI-Instruct/ && {
62
- echo "Successfully started web demo. Open 'http://localhost:${PORT}' to try!
63
- Run \`docker logs ${CONTAINER_NAME}\` to check demo status.
64
- Run \`docker rm -f ${CONTAINER_NAME}\` to stop and remove the demo."
65
- }