fix: Pin transformers version for torch compatibility

- Force reinstall torch 2.4.0 in Dockerfile
- Pin transformers==4.47.1 (known working with bitsandbytes)
- Fix set_submodule AttributeError
This commit is contained in:
2026-02-03 05:20:31 +00:00
parent 45b96e2094
commit 7a7b737cc0
2 changed files with 7 additions and 4 deletions

View File

@@ -5,8 +5,11 @@ WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt /app/requirements.txt
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Upgrade pip and install dependencies
# Force upgrade torch to ensure compatibility with transformers
RUN pip install --upgrade pip && \
pip install --no-cache-dir torch==2.4.0 --force-reinstall && \
pip install --no-cache-dir -r requirements.txt
# Copy handler and data
COPY handler.py /app/handler.py

View File

@@ -1,5 +1,5 @@
runpod>=1.7.0
transformers>=4.48.0
transformers==4.47.1
datasets>=2.16.0
accelerate>=0.30.0
boto3>=1.34.0
@@ -8,5 +8,5 @@ scipy>=1.11.0
safetensors>=0.4.0
requests>=2.31.0
peft>=0.14.0
bitsandbytes>=0.45.0
bitsandbytes==0.45.0
trl>=0.14.0