Spaces:
Runtime error
Runtime error
Commit ·
7715a98
1
Parent(s): 0e85410
fix: update ONNX URLs and remove Docker HEALTHCHECK for HF Spaces
Browse files- Dockerfile +3 -5
- app/core/model_downloader.py +2 -2
Dockerfile
CHANGED
|
@@ -39,10 +39,8 @@ COPY --chown=user:user . /app
|
|
| 39 |
|
| 40 |
EXPOSE 7860
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
#
|
| 44 |
-
#
|
| 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/
|
| 39 |
-
"https://huggingface.co/
|
| 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 |
},
|