Spaces:
Sleeping
Sleeping
File size: 1,001 Bytes
8f3097b b0095ef 8f3097b 586c40f 8f3097b b0095ef 6b5f0df 8f3097b b0095ef 8f3097b b0095ef 8f3097b b0095ef 8f3097b 6b5f0df 8f3097b b0095ef 8f3097b b0095ef 8f3097b b0095ef |
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 |
# Use the NVIDIA CUDA image with CUDNN and development tools
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
# Install Python and pip
RUN apt-get update && \
apt-get install -y python3-dev python3-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install git
RUN apt-get update && apt-get install -y git
# Create a user with UID 1000
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy the requirements file and install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip3 install --upgrade pip
RUN pip3 install packaging
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
# Install numpy version compatible with flash_attn
RUN pip3 install numpy==1.23.4
# Install flash_attn
RUN pip3 install flash_attn
# Copy the rest of the application
COPY --chown=user . /app
# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |