YashashMathur commited on
Commit
31fe512
·
verified ·
1 Parent(s): 524f673

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -13
Dockerfile CHANGED
@@ -20,30 +20,29 @@ 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 .
 
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 .