diff --git a/build_scripts/Dockerfile.inference.cn.from_scratch b/build_scripts/Dockerfile.inference.cn.from_scratch index 9f6a8c3f..cbc43bfa 100644 --- a/build_scripts/Dockerfile.inference.cn.from_scratch +++ b/build_scripts/Dockerfile.inference.cn.from_scratch @@ -48,7 +48,8 @@ RUN wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-pat wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tokenizer_config.json && \ wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/vocab.json -RUN wget -O /opt/ml/code/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors +#RUN wget -O /opt/ml/code/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors + RUN pip install -r /opt/ml/code/requirements_versions.txt && \ pip install https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip && \ pip install https://github.com/mlfoundations/open_clip/archive/bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b.zip && \ diff --git a/build_scripts/Dockerfile.utils.cn.from_scratch b/build_scripts/Dockerfile.utils.cn.from_scratch index a2687cbe..5d7b8197 100644 --- a/build_scripts/Dockerfile.utils.cn.from_scratch +++ b/build_scripts/Dockerfile.utils.cn.from_scratch @@ -33,22 +33,23 @@ RUN pip install -r /opt/ml/code/extensions/sd_dreambooth_extension/requirements. apt-get install -y google-perftools # prepare environment fow webui -RUN mkdir /opt/ml/code/openai -RUN wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/.gitattributes && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/README.md && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/config.json && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/flax_model.msgpack && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/merges.txt && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/preprocessor_config.json && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/pytorch_model.bin && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/special_tokens_map.json && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tf_model.h5 && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tokenizer.json && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tokenizer_config.json && \ - wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/vocab.json +#RUN mkdir /opt/ml/code/openai +#RUN wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/.gitattributes && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/README.md && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/config.json && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/flax_model.msgpack && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/merges.txt && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/preprocessor_config.json && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/pytorch_model.bin && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/special_tokens_map.json && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tf_model.h5 && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tokenizer.json && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/tokenizer_config.json && \ +# wget -P /opt/ml/code/openai https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/vocab.json + +#RUN wget -O /opt/ml/code/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors -RUN wget -O /opt/ml/code/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors RUN pip install -r /opt/ml/code/requirements_versions.txt && \ pip install https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip && \ pip install https://github.com/mlfoundations/open_clip/archive/bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b.zip && \ diff --git a/build_scripts/inference/cn_serve b/build_scripts/inference/cn_serve index 0c1ae763..a17815da 100755 --- a/build_scripts/inference/cn_serve +++ b/build_scripts/inference/cn_serve @@ -1,5 +1,5 @@ import os +os.system(f'./tools/s5cmd cp https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/models/v1-5-pruned-emaonly.safetensors ./models/Stable-diffusion') cmd = "accelerate launch --num_cpu_threads_per_process=6 launch.py --api --listen --port 8080 --xformers --no-half-vae --skip-prepare-environment --no-download-sd-model" - os.system(cmd) diff --git a/build_scripts/utils/cn_serve b/build_scripts/utils/cn_serve index 27acf885..935dae84 100755 --- a/build_scripts/utils/cn_serve +++ b/build_scripts/utils/cn_serve @@ -1,5 +1,37 @@ import os +os.system(f'./tools/s5cmd cp https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/models/v1-5-pruned-emaonly.safetensors ./models/Stable-diffusion') + cmd = "accelerate launch --num_cpu_threads_per_process=6 launch.py --nowebui --api --listen --port 8080 --skip-torch-cuda-test --skip-prepare-environment --no-download-sd-model" +download_cmd_1 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/config.json" +download_cmd_2 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/flax_model.msgpack" +download_cmd_3 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/.gitattributes" +download_cmd_4 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/README.md" +download_cmd_5 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/flax_model.msgpack" +download_cmd_6 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/merges.txt" +download_cmd_7 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/model.safetensors" +download_cmd_8 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/preprocessor_config.json" +download_cmd_9 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/pytorch_model.bin" +download_cmd_10 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/special_tokens_map.json" +download_cmd_11 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/tf_model.h5" +download_cmd_12 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/tokenizer.json" +download_cmd_13 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/tokenizer_config.json" +download_cmd_14 = "wget -P ./openai https://aws-gcr-solutions.s3.cn-north-1.amazonaws.com.cn/stable-diffusion-aws-extension-github-mainline/openai-resources/14/vocab.json" + +os.system(download_cmd_1) +os.system(download_cmd_2) +os.system(download_cmd_3) +os.system(download_cmd_4) +os.system(download_cmd_5) +os.system(download_cmd_6) +os.system(download_cmd_7) +os.system(download_cmd_8) +os.system(download_cmd_9) +os.system(download_cmd_10) +os.system(download_cmd_11) +os.system(download_cmd_12) +os.system(download_cmd_13) +os.system(download_cmd_14) + os.system(cmd)