Rafs-an09002 commited on
Commit
073e69f
·
verified ·
1 Parent(s): 6955644

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -20
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Nexus-Nano Inference - Fixed Build
2
  # Ultra Lightweight
3
 
4
  FROM python:3.10-slim
@@ -12,35 +12,22 @@ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Create models folder BEFORE download
16
- RUN mkdir -p /app/models
17
-
18
  # Copy application
19
  COPY app.py .
20
 
21
- # Download Nexus-Nano model
22
- RUN python -c "from huggingface_hub import hf_hub_download; \
23
- print('Downloading Nexus-Nano model...'); \
24
- hf_hub_download( \
25
- repo_id='GambitFlow/Nexus-Nano', \
26
- filename='nexus_nano.onnx', \
27
- local_dir='/app/models', \
28
- local_dir_use_symlinks=False \
29
- ); \
30
- print('Download complete!')"
31
-
32
- # Verify model exists
33
- RUN ls -lh /app/models/ && \
34
- test -f /app/models/nexus_nano.onnx && \
35
- echo "✅ Model file verified" || \
36
- (echo "❌ Model file missing!" && exit 1)
37
 
38
  EXPOSE 7860
39
 
 
40
  ENV PYTHONUNBUFFERED=1
41
  ENV OMP_NUM_THREADS=2
 
42
 
 
43
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
44
  CMD curl -f http://localhost:7860/health || exit 1
45
 
 
46
  CMD ["python", "app.py"]
 
1
+ # Nexus-Nano Inference - Fixed for Manual Model Upload
2
  # Ultra Lightweight
3
 
4
  FROM python:3.10-slim
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
 
 
 
15
  # Copy application
16
  COPY app.py .
17
 
18
+ # Model is already uploaded to /app/models/ by HF Spaces
19
+ # No download needed!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  EXPOSE 7860
22
 
23
+ # Environment variables
24
  ENV PYTHONUNBUFFERED=1
25
  ENV OMP_NUM_THREADS=2
26
+ ENV ONNXRUNTIME_EXECUTION_MODE=sequential
27
 
28
+ # Health check
29
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
30
  CMD curl -f http://localhost:7860/health || exit 1
31
 
32
+ # Run
33
  CMD ["python", "app.py"]