Spaces:
Runtime error
Runtime error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +18 -4
Dockerfile
CHANGED
|
@@ -3,9 +3,11 @@ FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# System dependencies
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
python3.10 \
|
| 8 |
python3-pip \
|
|
|
|
| 9 |
git \
|
| 10 |
build-essential \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -16,13 +18,25 @@ USER user
|
|
| 16 |
ENV HOME=/home/user \
|
| 17 |
PATH=/home/user/.local/bin:$PATH \
|
| 18 |
PYTHONUNBUFFERED=1 \
|
| 19 |
-
FORCE_CUDA="1"
|
|
|
|
| 20 |
|
| 21 |
WORKDIR /home/user/app
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Secure Application Code
|
| 28 |
COPY --chown=user:user aegis_env aegis_env/
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# System dependencies
|
| 6 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
python3.10 \
|
| 9 |
python3-pip \
|
| 10 |
+
python3.10-dev \
|
| 11 |
git \
|
| 12 |
build-essential \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 18 |
ENV HOME=/home/user \
|
| 19 |
PATH=/home/user/.local/bin:$PATH \
|
| 20 |
PYTHONUNBUFFERED=1 \
|
| 21 |
+
FORCE_CUDA="1" \
|
| 22 |
+
LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
|
| 23 |
|
| 24 |
WORKDIR /home/user/app
|
| 25 |
|
| 26 |
+
# 1. Upgrade pip
|
| 27 |
+
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
| 28 |
+
|
| 29 |
+
# 2. Install Synced PyTorch Stack
|
| 30 |
+
RUN python3 -m pip install --no-cache-dir torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
|
| 31 |
+
|
| 32 |
+
# 3. Install Unsloth
|
| 33 |
+
RUN python3 -m pip install --no-cache-dir "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
|
| 34 |
+
|
| 35 |
+
# 4. Install HF Stack normally (letting pip resolve dependencies)
|
| 36 |
+
RUN python3 -m pip install --no-cache-dir transformers==4.45.0 peft==0.13.0 trl==0.11.0 accelerate bitsandbytes datasets huggingface_hub gradio scipy sentencepiece protobuf safetensors
|
| 37 |
+
|
| 38 |
+
# 5. Surgical strike against torchao
|
| 39 |
+
RUN python3 -m pip uninstall -y torchao
|
| 40 |
|
| 41 |
# Secure Application Code
|
| 42 |
COPY --chown=user:user aegis_env aegis_env/
|