MuhammadMahmoud commited on
Commit
7715a98
·
1 Parent(s): 0e85410

fix: update ONNX URLs and remove Docker HEALTHCHECK for HF Spaces

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -5
  2. app/core/model_downloader.py +2 -2
Dockerfile CHANGED
@@ -39,10 +39,8 @@ COPY --chown=user:user . /app
39
 
40
  EXPOSE 7860
41
 
42
- # ─── 6. Health check ──────────────────────────────────────────────────────────
43
- # Using 127.0.0.1 instead of localhost to prevent IPv6 DNS resolution issues
44
- # which can cause the healthcheck to fail on some Linux kernels.
45
- HEALTHCHECK --interval=30s --timeout=15s --start-period=180s --retries=5 \
46
- CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7860/health', timeout=10)" || exit 1
47
 
48
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
39
 
40
  EXPOSE 7860
41
 
42
+ # Note: We omit custom Docker HEALTHCHECK here because Hugging Face Spaces
43
+ # automatically orchestrates and probes port 7860. A custom Docker healthcheck
44
+ # can conflict and cause the Space to hang in "Starting".
 
 
45
 
46
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
app/core/model_downloader.py CHANGED
@@ -35,8 +35,8 @@ _MODELS: list[dict] = [
35
  {
36
  "name": "yolov8n.onnx",
37
  "urls": [
38
- "https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.onnx",
39
- "https://huggingface.co/Bingsu/yolov8/resolve/main/yolov8n.onnx"
40
  ],
41
  "dest_dir_key": "ml_models",
42
  },
 
35
  {
36
  "name": "yolov8n.onnx",
37
  "urls": [
38
+ "https://github.com/ibaiGorordo/ONNX-YOLOv8-Object-Detection/raw/main/models/yolov8n.onnx",
39
+ "https://huggingface.co/spaces/yash2406/YOLOv8-Object-Detection-using-ONNX/resolve/main/models/yolov8n.onnx"
40
  ],
41
  "dest_dir_key": "ml_models",
42
  },