Spaces:
Runtime error
Runtime error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +12 -13
Dockerfile
CHANGED
|
@@ -20,30 +20,29 @@ ENV PATH="/home/user/.local/bin:${PATH}"
|
|
| 20 |
WORKDIR /home/user/app
|
| 21 |
|
| 22 |
# ============================================================
|
| 23 |
-
#
|
| 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
|
| 30 |
-
RUN python3 -m pip install torch==2.3.1
|
| 31 |
|
| 32 |
-
# c. Install transformers (MUST be 4.44.
|
| 33 |
RUN python3 -m pip install transformers==4.44.2
|
| 34 |
|
| 35 |
-
# d. Install
|
|
|
|
|
|
|
|
|
|
| 36 |
RUN python3 -m pip install unsloth
|
| 37 |
|
| 38 |
-
#
|
| 39 |
RUN python3 -m pip install unsloth_zoo
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
RUN python3 -m pip install
|
| 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 .
|
|
|
|
| 20 |
WORKDIR /home/user/app
|
| 21 |
|
| 22 |
# ============================================================
|
| 23 |
+
# CRITICAL: Version pinning for unsloth compatibility
|
| 24 |
# ============================================================
|
| 25 |
|
| 26 |
# a. Upgrade pip first
|
| 27 |
+
RUN python3 -m pip install --upgrade pip setuptools wheel
|
| 28 |
|
| 29 |
+
# b. Install torch with CUDA 12.1 (MUST be 2.3.1 - 2.4.0 breaks unsloth_zoo)
|
| 30 |
+
RUN python3 -m pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu121
|
| 31 |
|
| 32 |
+
# c. Install transformers (MUST be 4.44.2 - 4.46+ breaks Unpack import)
|
| 33 |
RUN python3 -m pip install transformers==4.44.2
|
| 34 |
|
| 35 |
+
# d. Install xformers (compatible version)
|
| 36 |
+
RUN python3 -m pip install xformers==0.0.27
|
| 37 |
+
|
| 38 |
+
# e. Install unsloth AFTER torch and transformers
|
| 39 |
RUN python3 -m pip install unsloth
|
| 40 |
|
| 41 |
+
# f. Install unsloth_zoo (MUST be after unsloth)
|
| 42 |
RUN python3 -m pip install unsloth_zoo
|
| 43 |
|
| 44 |
+
# g. Install other required packages
|
| 45 |
+
RUN python3 -m pip install peft accelerate bitsandbytes datasets huggingface_hub wandb trl openai pydantic pyyaml fastapi uvicorn
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# Copy application code
|
| 48 |
COPY --chown=user:user train.py .
|