FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel # FOR HF USER root ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ git \ cmake \ python3 \ python3-pip \ python3-venv \ python3-dev \ python3-numpy \ gcc \ build-essential \ gfortran \ wget \ curl \ pkg-config \ software-properties-common \ zip \ && apt-get clean && rm -rf /tmp/* /var/tmp/* RUN apt-get update && DEBIAN_FRONTEND=noninteractive \ apt-get install -y python3.10 python3-pip RUN apt-get install -y libopenblas-base libopenmpi-dev ENV TZ=Asia/Dubai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN useradd -m -u 1000 user RUN apt-get update && apt-get install -y sudo && \ echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH RUN mkdir $HOME/app # WORKDIR $HOME/app RUN chown -R user:user $HOME/app USER user WORKDIR $HOME/app RUN python3 -m pip install chromadb db-sqlite3 auto-gptq exllama sqlalchemy WORKDIR $HOME/app # ENV FLASH_ATTENTION_FORCE_BUILD=TRUE RUN python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 RUN python -m pip install accelerate diffusers datasets timm flash-attn==2.6.1 gradio RUN python3 -m pip install --no-deps optimum #This seems to be a must : Intel Extension for PyTorch 2.4 needs to work with PyTorch 2.4.*, but PyTorch 2.2.2 is RUN python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 RUN python3 -m pip install -U accelerate bitsandbytes RUN python3 -m pip install -U git+https://github.com/huggingface/transformers WORKDIR $HOME/app COPY --chown=user:user Q_app_llm_pairs_gen.py . COPY --chown=user:user Q_llm_prompts.py . COPY --chown=user:user Q_quantum_utils.py . ENV PYTHONUNBUFFERED=1 GRADIO_ALLOW_FLAGGING=never GRADIO_NUM_PORTS=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 SYSTEM=spaces RUN python3 -m pip install pennylane sympy pennylane-qiskit duckdb qutip qutip-qip WORKDIR $HOME/app EXPOSE 8097 7842 8501 8000 6666 7860 CMD ["python", "Q_app_llm_pairs_gen.py"]