vasiuuu commited on
Commit
574aeb2
·
1 Parent(s): ab48b50

Force-downgrade torchao to 0.6.1 after unsloth to fix register_constant crash

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -2
Dockerfile CHANGED
@@ -9,10 +9,19 @@ ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
  WORKDIR /app
11
 
12
- # Upgrade pip and install unsloth properly
13
  RUN pip install --no-cache-dir --upgrade pip
 
 
14
  RUN pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
15
- RUN pip install --no-cache-dir trl
 
 
 
 
 
 
 
16
 
17
  COPY --chown=user ./requirements.txt requirements.txt
18
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
9
 
10
  WORKDIR /app
11
 
12
+ # Upgrade pip
13
  RUN pip install --no-cache-dir --upgrade pip
14
+
15
+ # Install unsloth from GitHub (it will drag in a bleeding-edge torchao)
16
  RUN pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
17
+
18
+ # CRITICAL: Force-downgrade torchao to last known-good version AFTER unsloth
19
+ # torchao>=0.7 requires torch.utils._pytree.register_constant which does not
20
+ # exist in any stable PyTorch release yet.
21
+ RUN pip install --no-cache-dir --force-reinstall "torchao==0.6.1"
22
+
23
+ # Pin trl and transformers to stable versions
24
+ RUN pip install --no-cache-dir "trl>=0.15,<0.17" "transformers>=4.47,<4.51"
25
 
26
  COPY --chown=user ./requirements.txt requirements.txt
27
  RUN pip install --no-cache-dir --upgrade -r requirements.txt