Fix Docker build: install torch before torch_scatter
Browse files- Dockerfile +9 -3
- requirements.txt +1 -3
Dockerfile
CHANGED
|
@@ -7,7 +7,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 7 |
build-essential git && \
|
| 8 |
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
COPY requirements.txt .
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
|
@@ -18,8 +24,8 @@ COPY . .
|
|
| 18 |
RUN pip install --no-cache-dir -e .
|
| 19 |
|
| 20 |
# Streamlit config
|
| 21 |
-
RUN mkdir -p /root/.streamlit
|
| 22 |
-
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
|
|
|
| 7 |
build-essential git && \
|
| 8 |
rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Step 1: Install torch first (needed by torch_scatter/torch_sparse at build time)
|
| 11 |
+
RUN pip install --no-cache-dir torch==2.6.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 12 |
+
|
| 13 |
+
# Step 2: Install torch extensions that need torch at setup time
|
| 14 |
+
RUN pip install --no-cache-dir torch_scatter torch_sparse -f https://data.pyg.org/whl/torch-2.6.0+cpu.html
|
| 15 |
+
|
| 16 |
+
# Step 3: Other Python deps
|
| 17 |
COPY requirements.txt .
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
|
|
|
| 24 |
RUN pip install --no-cache-dir -e .
|
| 25 |
|
| 26 |
# Streamlit config
|
| 27 |
+
RUN mkdir -p /root/.streamlit && \
|
| 28 |
+
printf '[server]\nheadless = true\nport = 7860\nenableCORS = false\nenableXsrfProtection = false\n' > /root/.streamlit/config.toml
|
| 29 |
|
| 30 |
EXPOSE 7860
|
| 31 |
|
requirements.txt
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
# PETIMOT Explorer — HuggingFace Spaces
|
|
|
|
| 2 |
streamlit>=1.30.0
|
| 3 |
stmol>=0.0.9
|
| 4 |
py3Dmol>=2.0.0
|
| 5 |
plotly>=5.18.0
|
| 6 |
pandas>=2.0.0
|
| 7 |
numpy>=1.24.0
|
| 8 |
-
torch>=2.0.0
|
| 9 |
torch_geometric>=2.0.0
|
| 10 |
-
torch_scatter
|
| 11 |
-
torch_sparse
|
| 12 |
transformers>=4.30.0
|
| 13 |
sentencepiece>=0.1.99
|
| 14 |
scipy>=1.10.0
|
|
|
|
| 1 |
# PETIMOT Explorer — HuggingFace Spaces
|
| 2 |
+
# Note: torch, torch_scatter, torch_sparse installed separately in Dockerfile
|
| 3 |
streamlit>=1.30.0
|
| 4 |
stmol>=0.0.9
|
| 5 |
py3Dmol>=2.0.0
|
| 6 |
plotly>=5.18.0
|
| 7 |
pandas>=2.0.0
|
| 8 |
numpy>=1.24.0
|
|
|
|
| 9 |
torch_geometric>=2.0.0
|
|
|
|
|
|
|
| 10 |
transformers>=4.30.0
|
| 11 |
sentencepiece>=0.1.99
|
| 12 |
scipy>=1.10.0
|