File size: 2,222 Bytes
8248c84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5ebbc77
8248c84
 
dab5043
 
6246989
e400047
6246989
8248c84
 
41e6c53
8248c84
 
 
 
1c69922
5ebbc77
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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"]