Spaces:
Sleeping
Sleeping
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
# you will also find guides on how best to write your Dockerfile | |
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 | |
RUN apt-get update && apt-get upgrade -y | |
RUN apt-get install -y python3-pip python3-dev | |
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y | |
RUN apt-get install -y git | |
RUN pip3 install --upgrade pip | |
RUN pip3 install packaging | |
RUN pip install --no-cache-dir numpy==1.23.5 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
WORKDIR /app | |
COPY --chown=user ./requirements.txt requirements.txt | |
# Install torch first | |
RUN pip install --no-cache-dir torch==2.1.2 | |
# Now install the rest of the packages | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
RUN pip install flash_attn | |
COPY --chown=user . /app | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |