Safetensors
GeoText1652_model / Dockerfile
mhassanch's picture
Refactor Docker setup for GeoText-1652 inference endpoint
f9c869c
Raw History Blame Contribute Delete
1.15 kB
# Python 3.8 and CUDA 11.8 match the upstream GeoText-1652 runtime.
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
GEOTEXT_SOURCE_DIR=/app/GeoText-1652 \
GEOTEXT_MODEL_DIR=/repository
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
curl \
libgl1 \
libglib2.0-0 \
python3.8 \
python3.8-dev \
python3.8-distutils \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://bootstrap.pypa.io/pip/3.8/get-pip.py | python3.8 \
&& python3.8 -m pip install --no-cache-dir \
--index-url https://download.pytorch.org/whl/cu118 \
torch==2.0.1 torchvision==0.15.2
WORKDIR /app
COPY requirements.txt ./requirements.txt
RUN python3.8 -m pip install --no-cache-dir -r requirements.txt
# Method is code only; model checkpoints are excluded by .dockerignore.
COPY infer.py server.py ./
COPY GeoText-1652/Method ./GeoText-1652/Method
EXPOSE 8000
CMD ["python3.8", "-m", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]