Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ---- Base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# ---- System deps
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
git build-essential && \
|
| 7 |
+
rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# ---- Python deps
|
| 10 |
+
# By default this installs CPU Torch. If you build on a GPU runner and want CUDA,
|
| 11 |
+
# uncomment the second pip line and comment out the first.
|
| 12 |
+
RUN pip install --no-cache-dir \
|
| 13 |
+
transformers accelerate torch sentencepiece safetensors gradio==4.44.0
|
| 14 |
+
|
| 15 |
+
# For CUDA builds (optional):
|
| 16 |
+
# RUN pip install --no-cache-dir \
|
| 17 |
+
# transformers accelerate sentencepiece safetensors gradio==4.44.0 && \
|
| 18 |
+
# pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 torch==2.3.1+cu121
|
| 19 |
+
|
| 20 |
+
# ---- Cache & runtime env
|
| 21 |
+
ENV HF_HOME=/root/.cache/huggingface \
|
| 22 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 23 |
+
GRADIO_SERVER_PORT=7860 \
|
| 24 |
+
PYTHONUNBUFFERED=1 \
|
| 25 |
+
TOKENIZERS_PARALLELISM=false
|
| 26 |
+
|
| 27 |
+
# ---- App files
|
| 28 |
+
WORKDIR /app
|
| 29 |
+
COPY app.py chat.py /app/
|
| 30 |
+
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
CMD ["python", "app.py"]
|