Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -12
Dockerfile
CHANGED
|
@@ -1,11 +1,6 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
-
curl \
|
| 6 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
-
|
| 8 |
-
# Konfiguracja środowiska
|
| 9 |
ENV PYTHONUNBUFFERED=1 \
|
| 10 |
PORT=7860 \
|
| 11 |
LLAMA_NO_CUDA=1 \
|
|
@@ -13,14 +8,21 @@ ENV PYTHONUNBUFFERED=1 \
|
|
| 13 |
LLAMA_NO_VULKAN=1 \
|
| 14 |
USE_MMAP=1 \
|
| 15 |
USE_MLOCK=0 \
|
| 16 |
-
FLASH_ATTN=0
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
# Instalacja
|
|
|
|
| 22 |
RUN pip install --no-cache-dir \
|
| 23 |
huggingface_hub>=0.24.0 \
|
|
|
|
|
|
|
|
|
|
| 24 |
llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 25 |
|
| 26 |
WORKDIR /app
|
|
@@ -28,5 +30,5 @@ COPY app.py .
|
|
| 28 |
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
#
|
| 32 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Zmienne środowiskowe dla optymalizacji
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
ENV PYTHONUNBUFFERED=1 \
|
| 5 |
PORT=7860 \
|
| 6 |
LLAMA_NO_CUDA=1 \
|
|
|
|
| 8 |
LLAMA_NO_VULKAN=1 \
|
| 9 |
USE_MMAP=1 \
|
| 10 |
USE_MLOCK=0 \
|
| 11 |
+
FLASH_ATTN=0
|
| 12 |
+
|
| 13 |
+
# Instalacja zależności systemowych
|
| 14 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
+
curl \
|
| 16 |
+
ca-certificates \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
+
# Instalacja Python dependencies
|
| 20 |
+
# Ważne: Najpierw uvicorn/fastapi, potem llama-cpp-python
|
| 21 |
RUN pip install --no-cache-dir \
|
| 22 |
huggingface_hub>=0.24.0 \
|
| 23 |
+
uvicorn>=0.30.0 \
|
| 24 |
+
fastapi>=0.115.0 \
|
| 25 |
+
pydantic-settings \
|
| 26 |
llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 27 |
|
| 28 |
WORKDIR /app
|
|
|
|
| 30 |
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
+
# Uruchomienie skryptu startowego
|
| 34 |
CMD ["python", "app.py"]
|