File size: 2,189 Bytes
c984e43
2fc6bee
 
 
23df16c
 
 
 
 
 
c531635
2fc6bee
c531635
2fc6bee
 
 
 
 
 
ce48e72
bb363fd
 
 
ce48e72
c984e43
 
c531635
 
 
c984e43
 
a01fd21
c984e43
 
 
 
bb363fd
 
 
 
 
 
 
 
 
 
c984e43
 
c531635
 
 
 
18db1d7
ce48e72
f39a39a
c531635
f39a39a
 
 
 
 
 
 
18db1d7
2fc6bee
23df16c
 
 
 
 
 
 
 
 
c531635
18db1d7
c531635
c984e43
 
 
2fc6bee
c984e43
 
 
 
2fc6bee
c984e43
2fc6bee
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM python:3.10-slim

WORKDIR /app

# Environment variables for CPU-only operation
ENV CUDA_VISIBLE_DEVICES=-1 \
    TF_CPP_MIN_LOG_LEVEL=3 \
    SDL_AUDIODRIVER=disk \
    VLLM_TARGET_DEVICE=cpu

# Install system dependencies (probably more than needed)
RUN apt-get update && apt-get install -y \
    build-essential \
    libportaudio2 \
    libportaudiocpp0 \
    portaudio19-dev \
    libasound-dev \
    libsndfile1-dev \
    kmod \
    libomp5 \
    libssl3 \
    ca-certificates \
    openssl \
    libopenblas0-pthread \
    libgl1 \
    libglib2.0-0 \
    libnuma-dev \
    gcc-12 \
    g++-12 \
    espeak-ng \
    libaio-dev \
    git \
    ffmpeg \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Install Rust compiler
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --default-toolchain stable --profile minimal && \
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /etc/profile.d/rust.sh

ENV PATH="/root/.cargo/bin:${PATH}"

# Verify installation
RUN rustc --version && cargo --version

# Update pip and install base requirements
RUN pip install --upgrade pip setuptools wheel && \
    pip install numpy \
    "cmake>=3.26" \
    packaging \
    ninja \
    "setuptools-scm>=8" --no-cache-dir

# Install Base PyTorch System - For CPU-only
RUN pip install \
  torch \
  torchvision \
  torchaudio \
  torchdatasets \
  torchtext \
  datasets \
  transformers \
  --extra-index-url https://download.pytorch.org/whl/cpu --no-cache-dir

# Install vLLM CPU version from source
RUN git clone https://github.com/vllm-project/vllm.git \
    && cd vllm \
    && pip install -v -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu \
    && python setup.py install \
    && pip install --no-cache-dir -e . \
    && cd .. \
    && rm -rf vllm

# Fix networkx compatibility
RUN pip install --force-reinstall --no-cache-dir networkx==3.2.1

# Install Python requirements with CPU-only constraints
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt --no-deps

# Install unidic for processing Japanese texts
RUN python -m unidic download

# Copy application files
COPY . .

EXPOSE 7860
CMD ["python", "app.py"]