Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -7
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# 1️⃣ Базовый
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# 2️⃣ Системные зависимости
|
|
@@ -8,17 +8,16 @@ RUN apt-get update && apt-get install -y git ffmpeg libsm6 libxext6 && rm -rf /v
|
|
| 8 |
WORKDIR /app
|
| 9 |
COPY . /app
|
| 10 |
|
| 11 |
-
# 4️⃣
|
| 12 |
RUN pip install --upgrade pip \
|
| 13 |
&& pip uninstall -y gradio gradio-client spaces huggingface-hub || true \
|
| 14 |
&& pip install --no-cache-dir -r requirements.txt \
|
| 15 |
-
&& pip install --no-cache-dir "transformers==4.46.0" "torch==2.4.1" \
|
| 16 |
-
&& pip install --force-reinstall --no-cache-dir "huggingface-hub==0.23.4" \
|
| 17 |
&& pip check
|
| 18 |
|
| 19 |
-
# 5️⃣
|
| 20 |
CMD bash -c "\
|
|
|
|
| 21 |
pip install --force-reinstall --no-cache-dir 'huggingface-hub==0.23.4' && \
|
|
|
|
| 22 |
python app.py"
|
| 23 |
-
|
| 24 |
-
|
|
|
|
| 1 |
+
# 1️⃣ Базовый Python
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# 2️⃣ Системные зависимости
|
|
|
|
| 8 |
WORKDIR /app
|
| 9 |
COPY . /app
|
| 10 |
|
| 11 |
+
# 4️⃣ Устанавливаем зависимости
|
| 12 |
RUN pip install --upgrade pip \
|
| 13 |
&& pip uninstall -y gradio gradio-client spaces huggingface-hub || true \
|
| 14 |
&& pip install --no-cache-dir -r requirements.txt \
|
| 15 |
+
&& pip install --no-cache-dir "transformers==4.46.0" "torch==2.4.1" "huggingface-hub==0.23.4" \
|
|
|
|
| 16 |
&& pip check
|
| 17 |
|
| 18 |
+
# 5️⃣ Финальный запуск с проверкой и переустановкой в runtime
|
| 19 |
CMD bash -c "\
|
| 20 |
+
echo '🚀 Checking environment...' && \
|
| 21 |
pip install --force-reinstall --no-cache-dir 'huggingface-hub==0.23.4' && \
|
| 22 |
+
python -c \"import huggingface_hub; print('✅ huggingface-hub version:', huggingface_hub.__version__)\" && \
|
| 23 |
python app.py"
|
|
|
|
|
|