davidtran999 commited on
Commit
ee0c705
·
verified ·
1 Parent(s): dec9146

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -22,15 +22,18 @@ COPY backend/requirements.txt /app/requirements.txt
22
  # Install CPU-only torch first (much smaller, no CUDA dependencies)
23
  # This avoids downloading 2GB+ of CUDA packages on CPU-only environments
24
  # CRITICAL: Install transformers>=4.50.0 BEFORE other packages to avoid conflicts
25
- RUN pip install --upgrade pip && \
 
 
26
  pip install --no-cache-dir torch==2.0.0 --index-url https://download.pytorch.org/whl/cpu && \
27
- pip uninstall -y transformers || true && \
28
  pip install --no-cache-dir --upgrade --force-reinstall \
29
  "transformers>=4.50.0,<5.0.0" \
30
  "sentence-transformers>=2.2.0" \
31
  "FlagEmbedding>=1.2.0" && \
32
  pip install --no-cache-dir -r requirements.txt && \
33
- pip show transformers | grep Version
 
34
 
35
  COPY backend /app
36
 
 
22
  # Install CPU-only torch first (much smaller, no CUDA dependencies)
23
  # This avoids downloading 2GB+ of CUDA packages on CPU-only environments
24
  # CRITICAL: Install transformers>=4.50.0 BEFORE other packages to avoid conflicts
25
+ # Remove transformers from requirements.txt temporarily to avoid conflicts
26
+ RUN sed -i '/^transformers/d' /app/requirements.txt && \
27
+ pip install --upgrade pip && \
28
  pip install --no-cache-dir torch==2.0.0 --index-url https://download.pytorch.org/whl/cpu && \
29
+ pip uninstall -y transformers sentence-transformers peft || true && \
30
  pip install --no-cache-dir --upgrade --force-reinstall \
31
  "transformers>=4.50.0,<5.0.0" \
32
  "sentence-transformers>=2.2.0" \
33
  "FlagEmbedding>=1.2.0" && \
34
  pip install --no-cache-dir -r requirements.txt && \
35
+ pip show transformers | grep Version && \
36
+ python3 -c "import transformers; print(f'[VERIFY] transformers version: {transformers.__version__}')"
37
 
38
  COPY backend /app
39