DeepSeek-OCR-vllm: update INPUT_PATH & Dockerfile envs
This commit is contained in:
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Cache directories
|
||||||
|
.cache/
|
||||||
|
__pycache__/
|
||||||
|
|
||||||
|
# Output directory
|
||||||
|
output/
|
||||||
|
|
||||||
|
# PDF files
|
||||||
|
*.pdf
|
||||||
@@ -21,9 +21,7 @@ MODEL_PATH = 'deepseek-ai/DeepSeek-OCR' # change to your model path
|
|||||||
# .jpg, .png, .jpeg: run_dpsk_ocr_image.py;
|
# .jpg, .png, .jpeg: run_dpsk_ocr_image.py;
|
||||||
# Omnidocbench images path: run_dpsk_ocr_eval_batch.py
|
# Omnidocbench images path: run_dpsk_ocr_eval_batch.py
|
||||||
|
|
||||||
FILE_NAME='2025-27484-M21472.pdf'
|
INPUT_PATH = f'/workspace/2018-0802140959-217049.pdf'
|
||||||
|
|
||||||
INPUT_PATH = f'/workspace/2025-27484-M21472.pdf'
|
|
||||||
OUTPUT_PATH = '/workspace/output/'
|
OUTPUT_PATH = '/workspace/output/'
|
||||||
|
|
||||||
PROMPT = '<image>\n<|grounding|>Convert the document to markdown.'
|
PROMPT = '<image>\n<|grounding|>Convert the document to markdown.'
|
||||||
|
|||||||
@@ -1,41 +1,39 @@
|
|||||||
# PyTorch 2.6.0 + CUDA 12.6 + cuDNN9
|
# PyTorch 2.6.0 + CUDA 12.6 + cuDNN9
|
||||||
FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
|
FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
|
||||||
|
|
||||||
# 기본 환경 변수
|
# 기본 환경 변수 설정
|
||||||
ENV DEBIAN_FRONTEND=noninteractive \
|
ENV DEBIAN_FRONTEND=noninteractive \
|
||||||
HF_HOME=/workspace/.cache/huggingface \
|
HF_HOME=/workspace/.cache/huggingface \
|
||||||
CUDA_HOME=/usr/local/cuda \
|
CUDA_HOME=/usr/local/cuda \
|
||||||
LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH} \
|
LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH} \
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||||||
PYTHONUNBUFFERED=1
|
PYTHONUNBUFFERED=1 \
|
||||||
|
TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas \
|
||||||
|
TORCH_CUDA_ARCH_LIST="8.0"
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# 필수 빌드 도구
|
# 필수 빌드 도구 설치
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git build-essential ninja-build \
|
git build-essential ninja-build \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# pip 툴업
|
# pip 업그레이드
|
||||||
RUN python -m pip install -U pip setuptools wheel packaging ninja
|
RUN python -m pip install -U pip setuptools wheel
|
||||||
|
|
||||||
# (베이스 이미지에 torch 2.6.0이 이미 포함)
|
# 기존 라이브러리 제거 및 특정 버전 재설치
|
||||||
# torchvision/torchaudio 버전을 보장하려면 아래 라인을 사용하세요.
|
RUN pip uninstall -y vllm torch torchvision torchaudio triton flash-attn || true
|
||||||
# cu126 인덱스가 없을 수 있으므로 실패해도 빌드가 계속되게 처리합니다.
|
RUN pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0
|
||||||
RUN pip install --no-cache-dir \
|
|
||||||
torchvision==0.21.0 torchaudio==2.6.0 \
|
|
||||||
--extra-index-url https://download.pytorch.org/whl/cu126 || \
|
|
||||||
echo "Skip reinstalling torchvision/torchaudio (fallback to base image)"
|
|
||||||
|
|
||||||
# 프로젝트 의존성 설치
|
# 프로젝트 의존성 설치
|
||||||
COPY requirements.txt /tmp/requirements.txt
|
COPY requirements.txt /tmp/requirements.txt
|
||||||
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
RUN pip install -r /tmp/requirements.txt
|
||||||
|
|
||||||
# vLLM 0.8.5 고정 (CUDA 12.x용 wheel 자동 선택)
|
# vLLM 특정 버전 설치
|
||||||
RUN pip install --no-cache-dir vllm==0.8.5
|
RUN pip install vllm==0.8.5
|
||||||
|
|
||||||
# FlashAttention (CUDA 12.6에서 빌드)
|
# FlashAttention 소스에서 빌드하여 설치
|
||||||
RUN pip install --no-cache-dir flash-attn==2.7.3 --no-build-isolation
|
RUN pip cache purge && \
|
||||||
|
pip install --no-cache-dir --no-build-isolation --no-binary=flash-attn flash-attn==2.7.3
|
||||||
|
|
||||||
# 작업 디렉터리 유지
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
Reference in New Issue
Block a user