Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -26
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Nexus-Core Inference - Fixed
|
| 2 |
# HF Spaces CPU (2 vCPU, 16GB RAM)
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
|
@@ -11,36 +11,17 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
curl \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Python dependencies
|
| 15 |
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
RUN mkdir -p /app/models /app/engine
|
| 20 |
-
|
| 21 |
-
# Copy application files
|
| 22 |
COPY app.py .
|
|
|
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
# Download Nexus-Core model from HuggingFace
|
| 29 |
-
RUN python -c "from huggingface_hub import hf_hub_download; \
|
| 30 |
-
print('Downloading Nexus-Core model...'); \
|
| 31 |
-
hf_hub_download( \
|
| 32 |
-
repo_id='GambitFlow/Nexus-Core', \
|
| 33 |
-
filename='nexus_core.onnx', \
|
| 34 |
-
local_dir='/app/models', \
|
| 35 |
-
local_dir_use_symlinks=False \
|
| 36 |
-
); \
|
| 37 |
-
print('Download complete!')"
|
| 38 |
-
|
| 39 |
-
# Verify model file exists
|
| 40 |
-
RUN ls -lh /app/models/ && \
|
| 41 |
-
test -f /app/models/nexus_core.onnx && \
|
| 42 |
-
echo "✅ Model file verified" || \
|
| 43 |
-
(echo "❌ Model file missing!" && exit 1)
|
| 44 |
|
| 45 |
EXPOSE 7860
|
| 46 |
|
|
@@ -48,9 +29,11 @@ EXPOSE 7860
|
|
| 48 |
ENV PYTHONUNBUFFERED=1
|
| 49 |
ENV OMP_NUM_THREADS=2
|
| 50 |
ENV MKL_NUM_THREADS=2
|
|
|
|
| 51 |
|
| 52 |
# Health check
|
| 53 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 54 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 55 |
|
|
|
|
| 56 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Nexus-Core Inference - Fixed for Manual Model Upload
|
| 2 |
# HF Spaces CPU (2 vCPU, 16GB RAM)
|
| 3 |
|
| 4 |
FROM python:3.10-slim
|
|
|
|
| 11 |
curl \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Python dependencies first (for caching)
|
| 15 |
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Copy application code
|
|
|
|
|
|
|
|
|
|
| 19 |
COPY app.py .
|
| 20 |
+
COPY engine/ ./engine/
|
| 21 |
|
| 22 |
+
# Model is already uploaded to /app/models/ by HF Spaces
|
| 23 |
+
# Just verify it exists at runtime
|
| 24 |
+
# No download needed!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
EXPOSE 7860
|
| 27 |
|
|
|
|
| 29 |
ENV PYTHONUNBUFFERED=1
|
| 30 |
ENV OMP_NUM_THREADS=2
|
| 31 |
ENV MKL_NUM_THREADS=2
|
| 32 |
+
ENV ONNXRUNTIME_EXECUTION_MODE=sequential
|
| 33 |
|
| 34 |
# Health check
|
| 35 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 36 |
CMD curl -f http://localhost:7860/health || exit 1
|
| 37 |
|
| 38 |
+
# Run application
|
| 39 |
CMD ["python", "app.py"]
|