Spaces:
Runtime error
Runtime error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +17 -17
Dockerfile
CHANGED
|
@@ -19,31 +19,31 @@ USER user
|
|
| 19 |
ENV PATH="/home/user/.local/bin:${PATH}"
|
| 20 |
WORKDIR /home/user/app
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
#
|
|
|
|
|
|
|
|
|
|
| 24 |
RUN python3 -m pip install --upgrade pip
|
| 25 |
|
| 26 |
-
# b.
|
| 27 |
-
RUN python3 -m pip install torch==2.
|
| 28 |
|
| 29 |
-
# c.
|
| 30 |
-
RUN python3 -m pip
|
| 31 |
|
| 32 |
-
# d.
|
| 33 |
-
RUN python3 -m pip install
|
| 34 |
|
| 35 |
-
#
|
| 36 |
RUN python3 -m pip install unsloth_zoo
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
RUN python3 -m pip install
|
| 40 |
-
|
| 41 |
-
# f. Fix transformers version (unsloth_zoo needs specific version - 4.46.x works)
|
| 42 |
-
RUN python3 -m pip install transformers==4.46.3
|
| 43 |
|
| 44 |
-
# Install
|
| 45 |
COPY --chown=user:user requirements.txt .
|
| 46 |
-
RUN python3 -m pip install -r requirements.txt
|
| 47 |
|
| 48 |
# Copy application code
|
| 49 |
COPY --chown=user:user train.py .
|
|
@@ -51,4 +51,4 @@ COPY --chown=user:user aegis_training_data_500.json .
|
|
| 51 |
|
| 52 |
EXPOSE 7860
|
| 53 |
|
| 54 |
-
CMD ["python3", "-u", "train.py"]
|
|
|
|
| 19 |
ENV PATH="/home/user/.local/bin:${PATH}"
|
| 20 |
WORKDIR /home/user/app
|
| 21 |
|
| 22 |
+
# ============================================================
|
| 23 |
+
# FIXED Installation Order - Critical for unsloth compatibility
|
| 24 |
+
# ============================================================
|
| 25 |
+
|
| 26 |
+
# a. Upgrade pip first
|
| 27 |
RUN python3 -m pip install --upgrade pip
|
| 28 |
|
| 29 |
+
# b. Install torch with CUDA 12.1 (MUST come first)
|
| 30 |
+
RUN python3 -m pip install torch==2.3.1+cu121 torchvision==0.18.1+cu121 torchaudio==2.3.1+cu121 --index-url https://download.pytorch.org/whl/cu121
|
| 31 |
|
| 32 |
+
# c. Install transformers (MUST be 4.44.x - 4.46.x for unsloth_zoo)
|
| 33 |
+
RUN python3 -m pip install transformers==4.44.2
|
| 34 |
|
| 35 |
+
# d. Install unsloth (core only, not the git version)
|
| 36 |
+
RUN python3 -m pip install unsloth
|
| 37 |
|
| 38 |
+
# e. Install unsloth_zoo (required dependency)
|
| 39 |
RUN python3 -m pip install unsloth_zoo
|
| 40 |
|
| 41 |
+
# f. Install other required packages
|
| 42 |
+
RUN python3 -m pip install xformers==0.0.27 peft accelerate bitsandbytes datasets huggingface_hub wandb trl
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
+
# g. Install any remaining requirements
|
| 45 |
COPY --chown=user:user requirements.txt .
|
| 46 |
+
RUN python3 -m pip install -r requirements.txt || true
|
| 47 |
|
| 48 |
# Copy application code
|
| 49 |
COPY --chown=user:user train.py .
|
|
|
|
| 51 |
|
| 52 |
EXPOSE 7860
|
| 53 |
|
| 54 |
+
CMD ["python3", "-u", "train.py"]
|