Skip to content

Commit

Permalink
Fix model download of dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hv0905 committed May 6, 2024
1 parent 39074ec commit 7873db0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions cpu-only.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7873db0

Please sign in to comment.