File size: 1,345 Bytes
c984e43
2fc6bee
 
 
c984e43
2fc6bee
 
 
 
 
 
 
ce48e72
 
c984e43
 
 
 
 
 
 
 
 
 
 
 
 
ce48e72
c984e43
 
 
2fc6bee
c984e43
 
2fc6bee
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libportaudio2 \
    libportaudiocpp0 \
    portaudio19-dev \
    libasound-dev \
    libsndfile1-dev \
    kmod \
    libomp5 \
    libopenblas0-pthread \
    libgl1 \
    libglib2.0-0 \
    gcc \
    espeak-ng \
    libaio-dev \
    ffmpeg \
    curl \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Update pip and install base requirements
RUN pip install --upgrade pip setuptools wheel && \
    pip install numpy==1.26.4

# Install CPU-only PyTorch first
RUN pip install --no-cache-dir torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 \
--index-url https://download.pytorch.org/whl/cpu

# Install CPU-only PyTorch components
RUN pip install torchaudio==2.2.2 --index-url https://download.pytorch.org/whl/cpu

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

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

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

# Copy application files
COPY . .

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

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