Spaces:
Build error
Build error
avoid installing librairies for gpu
#6
by
RCaz
- opened
- dockerfile +14 -21
- requirements.txt +10 -2
dockerfile
CHANGED
|
@@ -1,25 +1,18 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
fi
|
| 13 |
|
| 14 |
-
|
| 15 |
-
pip3 install --user -r requirements.txt; \
|
| 16 |
-
fi && \
|
| 17 |
-
pip3 install --user streamlit
|
| 18 |
-
|
| 19 |
-
COPY . .
|
| 20 |
-
|
| 21 |
-
EXPOSE 8501
|
| 22 |
-
|
| 23 |
-
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 24 |
-
|
| 25 |
-
CMD ["streamlit", "run", "app/Welcome.py", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.port", "8501", "--server.address", "0.0.0.0"]
|
|
|
|
| 1 |
+
FROM python:3.12-slim AS builder
|
| 2 |
|
| 3 |
+
# mimick container built for gradio
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1 curl \
|
| 6 |
+
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
| 7 |
+
&& apt-get install -y nodejs \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
WORKDIR /app
|
| 11 |
|
| 12 |
+
# install without gpu
|
| 13 |
+
RUN pip install --no-cache-dir -U pip
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
+
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 16 |
+
pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 17 |
|
| 18 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
langchain-core
|
| 2 |
langchain
|
| 3 |
langchain-community
|
| 4 |
langchain-openai
|
| 5 |
langchain-huggingface
|
|
|
|
| 6 |
gradio
|
| 7 |
-
|
| 8 |
-
faiss-cpu
|
| 9 |
python-dotenv
|
| 10 |
azure-storage-blob
|
|
|
|
| 1 |
+
--extra-index-url https://download.pytorch.org/whl/cpu
|
| 2 |
+
torch
|
| 3 |
+
torchvision
|
| 4 |
+
torchaudio
|
| 5 |
+
|
| 6 |
+
sentence-transformers
|
| 7 |
+
faiss-cpu
|
| 8 |
+
|
| 9 |
langchain-core
|
| 10 |
langchain
|
| 11 |
langchain-community
|
| 12 |
langchain-openai
|
| 13 |
langchain-huggingface
|
| 14 |
+
|
| 15 |
gradio
|
| 16 |
+
|
|
|
|
| 17 |
python-dotenv
|
| 18 |
azure-storage-blob
|