david167 commited on
Commit
67f9bcb
·
1 Parent(s): c6d6f6c

Fix version conflict: use PyTorch 2.5.0 + TorchVision 0.20.0 exact match

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -2
  2. app.py +1 -1
  3. requirements.txt +1 -1
Dockerfile CHANGED
@@ -22,8 +22,8 @@ WORKDIR /app
22
  # Copy requirements
23
  COPY requirements.txt .
24
 
25
- # Install PyTorch 2.5.1 with compatible TorchVision 0.20.0 - using safetensors to avoid CVE-2025-32434
26
- RUN pip install torch==2.5.1 torchvision==0.20.0 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121
27
 
28
  # Skip llama-cpp-python to avoid compilation - using transformers instead
29
 
 
22
  # Copy requirements
23
  COPY requirements.txt .
24
 
25
+ # Install PyTorch 2.5.0 with compatible TorchVision 0.20.0 - using safetensors to avoid CVE-2025-32434
26
+ RUN pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu121
27
 
28
  # Skip llama-cpp-python to avoid compilation - using transformers instead
29
 
app.py CHANGED
@@ -81,7 +81,7 @@ async def load_model():
81
  device_map="auto" if device == "cuda" else None,
82
  trust_remote_code=True,
83
  low_cpu_mem_usage=True,
84
- use_safetensors=True, # Force safetensors to avoid CVE-2025-32434 (PyTorch 2.5.1 vulnerable to torch.load RCE)
85
  token=hf_token
86
  )
87
 
 
81
  device_map="auto" if device == "cuda" else None,
82
  trust_remote_code=True,
83
  low_cpu_mem_usage=True,
84
+ use_safetensors=True, # Force safetensors to avoid CVE-2025-32434 (PyTorch 2.5.0 vulnerable to torch.load RCE)
85
  token=hf_token
86
  )
87
 
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
  fastapi==0.104.1
2
  uvicorn[standard]==0.24.0
3
  pydantic==2.5.0
4
- torch==2.5.1
5
  transformers>=4.35.0
6
  accelerate>=0.24.0
7
  bitsandbytes>=0.41.0
 
1
  fastapi==0.104.1
2
  uvicorn[standard]==0.24.0
3
  pydantic==2.5.0
4
+ torch==2.5.0
5
  transformers>=4.35.0
6
  accelerate>=0.24.0
7
  bitsandbytes>=0.41.0