Safetensors
File size: 1,161 Bytes
f9c869c
 
4d3c316
 
 
 
f9c869c
 
4d3c316
 
f9c869c
 
 
 
 
 
 
 
4d3c316
 
f9c869c
 
 
 
 
4d3c316
 
f9c869c
4d3c316
f9c869c
d35edd7
f9c869c
4d3c316
f9c869c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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 hub_storage.py ./
COPY GeoText-1652/Method ./GeoText-1652/Method

EXPOSE 8000
CMD ["python3.8", "-m", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]