YashashMathur commited on
Commit
854a3f5
·
verified ·
1 Parent(s): 466a284

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -40
Dockerfile CHANGED
@@ -1,48 +1,22 @@
1
- FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
 
4
 
5
- # Install python3.10 and git
6
- RUN apt-get update && apt-get install -y \
7
- python3.10 \
8
- python3-pip \
9
- python3.10-dev \
10
- git \
11
- && rm -rf /var/lib/apt/lists/*
12
 
13
- # Make python3.10 the default python3
14
- RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
 
 
 
 
15
 
16
- # Set up user
17
- RUN useradd -m -u 1000 user
18
- USER user
19
- ENV PATH="/home/user/.local/bin:${PATH}"
20
- WORKDIR /home/user/app
21
-
22
- # PIP Installation Sequence (Crucial)
23
- # a. pip install --upgrade pip
24
- RUN python3 -m pip install --upgrade pip
25
-
26
- # b. pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
27
- RUN python3 -m pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
28
-
29
- # c. pip uninstall -y torchao (ensure it is gone)
30
- RUN python3 -m pip uninstall -y torchao
31
-
32
- # d. pip install --no-deps "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
33
- RUN python3 -m pip install --no-deps "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
34
-
35
- # e. pip install --no-deps xformers==0.0.27 trl==0.11.0 peft accelerate bitsandbytes
36
- RUN python3 -m pip install --no-deps xformers==0.0.27 trl==0.11.0 peft accelerate bitsandbytes
37
-
38
- # Install other requirements
39
- COPY --chown=user:user requirements.txt .
40
- RUN python3 -m pip install -r requirements.txt
41
-
42
- # Copy application code
43
- COPY --chown=user:user train.py .
44
- COPY --chown=user:user aegis_training_data_500.json .
45
 
46
  EXPOSE 7860
47
 
48
- CMD ["python3", "-u", "train.py"]
 
 
1
+ FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5
 
6
+ WORKDIR /app
 
 
 
 
 
 
7
 
8
+ # Install Unsloth and training dependencies
9
+ RUN pip install --no-cache-dir \
10
+ "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git" \
11
+ && pip install --no-cache-dir --no-deps xformers \
12
+ && pip install --no-cache-dir \
13
+ trl peft accelerate bitsandbytes huggingface_hub safetensors
14
 
15
+ # Copy training script and dataset
16
+ COPY train.py .
17
+ COPY aegis_training_data_500.json .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  EXPOSE 7860
20
 
21
+ # -u for unbuffered stdout so logs appear in real time in HF Space console
22
+ CMD ["python", "-u", "train.py"]