Spaces:
Running
on
T4
Running
on
T4
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 AS builder | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
build-essential \ | |
python3.11 \ | |
python3-pip \ | |
python3.11-dev \ | |
python3.11-venv \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
RUN python3.11 -m venv /opt/venv | |
ENV PATH=/opt/venv/bin:$PATH \ | |
NVIDIA_VISIBLE_DEVICES=all \ | |
NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
COPY ./requirements.txt /app/requirements.txt | |
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt | |
RUN CMAKE_ARGS="-DLLAMA_CUDA=on" pip3 install --no-cache-dir llama-cpp-python | |
FROM qdrant/qdrant:latest | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
build-essential \ | |
ffmpeg \ | |
libsm6 \ | |
libxext6 \ | |
python3-pip \ | |
python3-dev \ | |
python3-venv \ | |
ninja-build \ | |
libmagic-dev \ | |
pandoc>=2.14.2 \ | |
libreoffice \ | |
tesseract-ocr \ | |
poppler-utils \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
RUN python3 -m venv /opt/venv | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:/opt/venv/bin:$PATH \ | |
PYTHONPATH=$HOME/app \ | |
PYTHONUNBUFFERED=1 \ | |
NVIDIA_VISIBLE_DEVICES=all \ | |
NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
SYSTEM=spaces \ | |
HF_HOME=/data/.huggingface | |
COPY --from=builder /opt/venv /opt/venv | |
WORKDIR $HOME/app | |
COPY --chown=user . $HOME/app | |
EXPOSE 8501 6334 | |
VOLUME ["${HF_HOME}/qdrant_storage:/qdrant/storage:z"] | |
CMD streamlit run app.py \ | |
--server.headless true \ | |
--server.enableCORS false \ | |
--server.enableXsrfProtection false \ | |
--server.fileWatcherType watchdog \ | |
--theme.backgroundColor "#EEE3D3" \ | |
--theme.secondaryBackgroundColor "#CCC8C2" \ | |
--theme.primaryColor "#EF792D" \ | |
--theme.textColor "#7D6654" |