File size: 781 Bytes
6b6c7d1
 
 
 
 
 
07a411e
 
 
 
 
 
 
 
 
c7d82d4
7641c1a
25b47ae
c7d82d4
7641c1a
e246a97
 
 
5de7020
c7d82d4
 
07a411e
6b6c7d1
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

COPY app.py .

# Install rust (needed for tokenizers)
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl build-essential \
    && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
    && . $HOME/.cargo/env \
    && rm -rf /var/lib/apt/lists/*

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

# Install Python packages with OLDER transformers version
RUN pip install --no-cache-dir \
    gradio==4.36.1 \
    transformers==4.38.0 \
    torch==2.1.0 \
    accelerate==0.33.0 \
    sentencepiece==0.2.0 \
    protobuf==3.20.3

# Install tokenizers separately
RUN pip install --no-cache-dir tokenizers==0.15.2

EXPOSE 7860

ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_SERVER_PORT=7860

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