5883565b87
- New endpoints: /api/v1/convert, /api/v1/extract, /api/v1/segment, /api/v1/ocr, /api/v1/table_rec, /api/v1/marker (deprecated), /api/v1/create-document, /api/v1/files/*, /api/v1/thumbnails - Async submit-and-poll pattern matching Datalab API spec - X-API-Key authentication via API_KEY env var - Filesystem-based request store for multi-worker support - OCR_BACKEND=deepseek mode: uses deepseek-ocr via ollama for OCR (prompt: <|grounding|>Free OCR.) - build_options() now propagates output_format to parsed_opts - Fixed docs page CSS curly brace conflict with .format() - Renamed marker_endpoint_referece.md -> marker_endpoint_reference.md - Containerfile: added poppler-utils, pandoc; 3 gunicorn workers - gunicorn.conf: post_fork hook for background worker threads
21 lines
809 B
Bash
21 lines
809 B
Bash
#!/usr/bin/env bash
|
|
# ===== entrypoint.sh =====
|
|
# Starts any pre-flight checks then exec's the CMD
|
|
|
|
set -euo pipefail
|
|
|
|
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:/opt/rocm/lib"
|
|
|
|
# Apply AMD/ROCm env overrides before anything loads torch
|
|
if [[ "${AMD_COMPUTE:-false}" == "true" ]]; then
|
|
export TORCH_DEVICE="${TORCH_DEVICE:-cuda}"
|
|
export TORCH_DEVICE_MODEL="${TORCH_DEVICE:-cuda}"
|
|
echo "[entrypoint] AMD compute enabled, TORCH_DEVICE=${TORCH_DEVICE}"
|
|
fi
|
|
|
|
# Check torch/ROCm availability
|
|
python3 -c "import torch; dev=torch.device('cuda' if torch.cuda.is_available() else 'cpu'); print(f'[entrypoint] PyTorch device: {dev}, ROCm: {torch.version.rocm if hasattr(torch.version, \"rocm\") else \"n/a\"}')" 2>&1
|
|
|
|
echo "[entrypoint] Starting marker-api on ${HOST:-0.0.0.0}:${PORT:-8001} ..."
|
|
exec "$@"
|