This commit is contained in:
2025-10-27 11:44:00 +09:00
parent 039842b465
commit 85e53bd404
4 changed files with 51 additions and 41 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
model_services/paddle_vl/output
data
model_services/dotc.ocr/dots

View File

@@ -1,42 +1,37 @@
services:
deepseek_ocr_vllm:
build:
context: .
dockerfile: Dockerfile.vllm
image: deepseek-ocr-vllm:cu126
container_name: deepseek_ocr_vllm
working_dir: /workspace
volumes:
- ./DeepSeek-OCR-master/DeepSeek-OCR-vllm:/workspace
gpus: all
shm_size: "8g"
ipc: "host"
environment:
- HF_HOME=/workspace/.cache/huggingface
- CUDA_HOME=/usr/local/cuda
- LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
- PIP_DISABLE_PIP_VERSION_CHECK=1
- PYTHONUNBUFFERED=1
tty: true
entrypoint: ["/bin/bash"]
1version: '3.8'
# deepseek_ocr_hf:
# build:
# context: .
# dockerfile: Dockerfile.hf
# image: deepseek-ocr-hf:cu126
# container_name: deepseek_ocr_hf
# working_dir: /workspace
# volumes:
# - ./DeepSeek-OCR-hf:/workspace
# gpus: all
# shm_size: "8g"
# ipc: "host"
# environment:
# - HF_HOME=/workspace/.cache/huggingface
# - CUDA_HOME=/usr/local/cuda
# - LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
# - PIP_DISABLE_PIP_VERSION_CHECK=1
# - PYTHONUNBUFFERED=1
# tty: true
# entrypoint: ["/bin/bash"]
services:
api_gateway:
build:
context: ./api_gateway
ports:
- "80:8000" # 호스트의 80번 포트를 게이트웨이의 8000번 포트로 연결
networks:
- vlm_network
depends_on:
- deepseek_ocr # deepseek_ocr 서비스가 시작된 후에 게이트웨이를 시작
restart: always
deepseek_ocr:
build:
context: ./model_services/deepseek_ocr
# deploy 키를 사용하여 GPU 리소스를 요청합니다.
# 이 설정은 docker-compose up --build 대신 docker stack deploy 또는 docker compose up --deploy와 함께 사용할 때 공식적으로 지원됩니다.
# 일반적인 docker-compose up에서도 동작하는 경우가 많습니다.
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1 # 1개의 GPU를 할당
capabilities: [gpu]
environment:
- NVIDIA_VISIBLE_DEVICES=all # 컨테이너가 모든 GPU를 볼 수 있도록 설정
- MODEL_PATH=deepseek-ai/deepseek-vl-7b-base # 사용할 모델 지정 (필요시 수정)
networks:
- vlm_network
restart: on-failure
networks:
vlm_network:
driver: bridge

View File

View File

@@ -0,0 +1,12 @@
from paddleocr import PaddleOCRVL
pipeline = PaddleOCRVL(
vl_rec_backend="vllm-server", vl_rec_server_url="http://127.0.0.1:8118/v1"
)
output = pipeline.predict(
"/home/jackjack/test/deepseek_ocr/data/20250708092450-131-769-592.jpg"
)
for res in output:
res.print()
res.save_to_json(save_path="output")
res.save_to_markdown(save_path="output")