From efbc9e5e8140666fbb9737bda026eb87a0f6a6aa Mon Sep 17 00:00:00 2001 From: "bill.peng" Date: Mon, 17 Apr 2023 21:37:22 +0800 Subject: [PATCH] git clone models --- ptuning/docker/guide.sh | 9 ++++++++- ptuning/docker/train_gpu/start.sh | 4 +++- ptuning/docker/train_gpu/train.gpu.Dockerfile | 11 +++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ptuning/docker/guide.sh b/ptuning/docker/guide.sh index cd7ba5c..e51f537 100644 --- a/ptuning/docker/guide.sh +++ b/ptuning/docker/guide.sh @@ -1,3 +1,10 @@ #!/usr/bin/env bash -docker build +# build docker for chatglm-6b training +docker build + +docker tag +docker login +docker push + +docker run -it - diff --git a/ptuning/docker/train_gpu/start.sh b/ptuning/docker/train_gpu/start.sh index 3269245..24a79ed 100644 --- a/ptuning/docker/train_gpu/start.sh +++ b/ptuning/docker/train_gpu/start.sh @@ -4,7 +4,9 @@ source /app/dev/miniconda3/bin/activate base conda env list -# update source +# update model and source +cd /app/source/ChatGLM-6B/ptuning/chatglm-6b || exit 1 +git pull cd /app/source/ChatGLM-6B/ptuning || exit 1 git pull diff --git a/ptuning/docker/train_gpu/train.gpu.Dockerfile b/ptuning/docker/train_gpu/train.gpu.Dockerfile index 2f285a6..6d4846f 100644 --- a/ptuning/docker/train_gpu/train.gpu.Dockerfile +++ b/ptuning/docker/train_gpu/train.gpu.Dockerfile @@ -15,7 +15,9 @@ ENV TZ=Asia/Shanghai RUN apt-get -y update && apt-get install -y wget && \ mkdir -p /app && wget -P /app https://repo.anaconda.com/miniconda/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh && \ cd /app && bash Miniconda3-py38_23.1.0-1-Linux-x86_64.sh -b -p /app/dev/miniconda3 && \ - source /app/dev/miniconda3/bin/activate base && conda init bash && source ~/.bashrc && conda env list + source /app/dev/miniconda3/bin/activate base && \ + conda init bash && source ~/.bashrc && conda env list \ + rm /app/Miniconda3-py38_23.1.0-1-Linux-x86_64.sh && ls -al /app/ # install chatglm-6b dependencies RUN source /app/dev/miniconda3/bin/activate base && conda env list && \ @@ -25,7 +27,10 @@ RUN source /app/dev/miniconda3/bin/activate base && conda env list && \ gradio==3.20.0 mdtex2html fastapi uvicorn requests RUN mkdir -p /app/source && cd /app/source && \ apt-get update -y && apt-get install -y git && \ - git clone --recursive https://github.com/zealotpb/ChatGLM-6B.git + git clone --recursive https://github.com/zealotpb/ChatGLM-6B.git && \ + cd /app/source/ChatGLM-6B/ptuning && \ + apt-get update -y && apt-get install -y git-lfs && git lfs install && \ + git clone --recursive https://huggingface.co/THUDM/chatglm-6b && ls -al chatglm-6b/ # copy start.sh COPY start.sh /usr/bin/start @@ -33,3 +38,5 @@ RUN chmod a+x /usr/bin/start # install necessary debug tools RUN apt-get update -y && apt-get install -y vim htop + +CMD ["/bin/bash"]