From 7873db09b7b6d24161034df9d9ccb4da841f6873 Mon Sep 17 00:00:00 2001 From: EdgeNeko Date: Tue, 7 May 2024 00:08:00 +0800 Subject: [PATCH] Fix model download of dockerfile --- Dockerfile | 10 +++++----- cpu-only.Dockerfile | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index adcb7a5..94c5ab1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,11 @@ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt RUN mkdir -p /opt/models && \ - huggingface-cli download --local-dir /opt/models/clip openai/clip-vit-large-patch14 model.safetensors *.txt *.json && \ - huggingface-cli download --local-dir /opt/models/bert google-bert/bert-base-chinese model.safetensors *.txt *.json && \ - huggingface-cli download --local-dir /opt/models/paddleocr pk5ls20/PaddleModel PaddleOCR2Pytorch/ch_ptocr_v4_det_infer.pth PaddleOCR2Pytorch/ch_ptocr_v4_rec_infer.pth \ - PaddleOCR2Pytorch/ch_ptocr_mobile_v2.0_cls_infer.pth PaddleOCR2Pytorch/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml \ - PaddleOCR2Pytorch/configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml ppocr_keys_v1.txt && \ + huggingface-cli download openai/clip-vit-large-patch14 'model.safetensors' '*.txt' '*.json' --local-dir /opt/models/clip && \ + huggingface-cli download google-bert/bert-base-chinese 'model.safetensors' '*.txt' '*.json' --local-dir /opt/models/bert && \ + huggingface-cli download pk5ls20/PaddleModel 'PaddleOCR2Pytorch/ch_ptocr_v4_det_infer.pth' 'PaddleOCR2Pytorch/ch_ptocr_v4_rec_infer.pth' \ + 'PaddleOCR2Pytorch/ch_ptocr_mobile_v2.0_cls_infer.pth' 'PaddleOCR2Pytorch/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml' \ + 'PaddleOCR2Pytorch/configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml' 'ppocr_keys_v1.txt' --local-dir /opt/models/paddleocr && \ rm -rf /root/.cache/huggingface ENV APP_MODEL__CLIP=/opt/models/clip diff --git a/cpu-only.Dockerfile b/cpu-only.Dockerfile index 15bdaa6..a1ab4a6 100644 --- a/cpu-only.Dockerfile +++ b/cpu-only.Dockerfile @@ -9,11 +9,11 @@ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt RUN mkdir -p /opt/models && \ - huggingface-cli download openai/clip-vit-large-patch14 model.safetensors *.txt *.json --local-dir /opt/models/clip && \ - huggingface-cli download google-bert/bert-base-chinese model.safetensors *.txt *.json --local-dir /opt/models/bert && \ - huggingface-cli download pk5ls20/PaddleModel PaddleOCR2Pytorch/ch_ptocr_v4_det_infer.pth PaddleOCR2Pytorch/ch_ptocr_v4_rec_infer.pth \ - PaddleOCR2Pytorch/ch_ptocr_mobile_v2.0_cls_infer.pth PaddleOCR2Pytorch/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml \ - PaddleOCR2Pytorch/configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml ppocr_keys_v1.txt --local-dir /opt/models/paddleocr && \ + huggingface-cli download openai/clip-vit-large-patch14 'model.safetensors' '*.txt' '*.json' --local-dir /opt/models/clip && \ + huggingface-cli download google-bert/bert-base-chinese 'model.safetensors' '*.txt' '*.json' --local-dir /opt/models/bert && \ + huggingface-cli download pk5ls20/PaddleModel 'PaddleOCR2Pytorch/ch_ptocr_v4_det_infer.pth' 'PaddleOCR2Pytorch/ch_ptocr_v4_rec_infer.pth' \ + 'PaddleOCR2Pytorch/ch_ptocr_mobile_v2.0_cls_infer.pth' 'PaddleOCR2Pytorch/configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_student.yml' \ + 'PaddleOCR2Pytorch/configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml' 'ppocr_keys_v1.txt' --local-dir /opt/models/paddleocr && \ rm -rf /root/.cache/huggingface ENV APP_MODEL__CLIP=/opt/models/clip