Spaces:
Runtime error
Runtime error
Commit ·
eda5768
1
Parent(s): 2ee3974
More fixes
Browse files- Dockerfile +6 -3
- main.py +6 -3
- requirements.txt +2 -2
Dockerfile
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
FROM nvidia/cuda:12.4.1-cudnn8-devel-ubuntu22.04
|
| 2 |
|
| 3 |
-
# Install Python and required system libraries
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
python3.10 \
|
|
|
|
|
|
|
| 6 |
python3-pip \
|
| 7 |
build-essential \
|
| 8 |
gcc \
|
|
@@ -14,8 +16,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 14 |
libxrender-dev \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
|
|
|
|
| 19 |
|
| 20 |
WORKDIR /code
|
| 21 |
|
|
|
|
| 1 |
FROM nvidia/cuda:12.4.1-cudnn8-devel-ubuntu22.04
|
| 2 |
|
| 3 |
+
# Install Python 3.10 and required system libraries
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
python3.10 \
|
| 6 |
+
python3.10-venv \
|
| 7 |
+
python3.10-dev \
|
| 8 |
python3-pip \
|
| 9 |
build-essential \
|
| 10 |
gcc \
|
|
|
|
| 16 |
libxrender-dev \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
+
# Set Python 3.10 as default
|
| 20 |
+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
|
| 21 |
+
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
|
| 22 |
|
| 23 |
WORKDIR /code
|
| 24 |
|
main.py
CHANGED
|
@@ -8,11 +8,14 @@ import json
|
|
| 8 |
import os
|
| 9 |
from datetime import datetime
|
| 10 |
from handler import EndpointHandler
|
| 11 |
-
from debug import run_all_checks
|
| 12 |
import numpy as np
|
| 13 |
|
| 14 |
-
# Run diagnostics on startup
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
app = FastAPI()
|
| 18 |
|
|
|
|
| 8 |
import os
|
| 9 |
from datetime import datetime
|
| 10 |
from handler import EndpointHandler
|
|
|
|
| 11 |
import numpy as np
|
| 12 |
|
| 13 |
+
# Run diagnostics on startup (safe import)
|
| 14 |
+
try:
|
| 15 |
+
from debug import run_all_checks
|
| 16 |
+
run_all_checks()
|
| 17 |
+
except Exception as e:
|
| 18 |
+
print(f"⚠️ Diagnostics failed to run: {e}")
|
| 19 |
|
| 20 |
app = FastAPI()
|
| 21 |
|
requirements.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
azure-storage-blob
|
| 2 |
-
onnxruntime-gpu==1.
|
| 3 |
insightface
|
| 4 |
opencv-python-headless
|
| 5 |
flask
|
| 6 |
flask-cors
|
| 7 |
-
numpy
|
| 8 |
scipy
|
| 9 |
pillow
|
| 10 |
requests
|
|
|
|
| 1 |
azure-storage-blob
|
| 2 |
+
onnxruntime-gpu==1.16.3
|
| 3 |
insightface
|
| 4 |
opencv-python-headless
|
| 5 |
flask
|
| 6 |
flask-cors
|
| 7 |
+
numpy<2.0
|
| 8 |
scipy
|
| 9 |
pillow
|
| 10 |
requests
|