Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -9
Dockerfile
CHANGED
|
@@ -2,24 +2,22 @@ FROM ghcr.io/ggml-org/llama.cpp:full
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install
|
| 6 |
-
RUN apt update && apt install -y python3 python3-pip python3-venv curl
|
| 7 |
|
| 8 |
-
#
|
| 9 |
RUN python3 -m venv /opt/venv
|
| 10 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 11 |
-
|
| 12 |
-
# Force install Gradio 5+ to support 'type="messages"'
|
| 13 |
RUN pip install --no-cache-dir -U pip
|
| 14 |
-
RUN pip install --no-cache-dir
|
| 15 |
|
| 16 |
-
# Download SmolLM2-1.7B
|
| 17 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; hf_hub_download(repo_id="bartowski/SmolLM2-1.7B-Instruct-GGUF", filename="SmolLM2-1.7B-Instruct-Q4_K_M.gguf", local_dir="/app")'
|
| 18 |
|
|
|
|
| 19 |
COPY app.py /app/app.py
|
| 20 |
COPY start.sh /app/start.sh
|
| 21 |
RUN chmod +x /app/start.sh
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
ENV VIRTUAL_ENV=/opt/venv
|
| 25 |
ENTRYPOINT ["/app/start.sh"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install Python and essential tools
|
| 6 |
+
RUN apt-get update && apt-get install -y python3 python3-pip python3-venv curl
|
| 7 |
|
| 8 |
+
# Set up a Virtual Environment and force install modern Gradio
|
| 9 |
RUN python3 -m venv /opt/venv
|
| 10 |
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
|
|
|
| 11 |
RUN pip install --no-cache-dir -U pip
|
| 12 |
+
RUN pip install --no-cache-dir "gradio>=5.0" requests huggingface_hub
|
| 13 |
|
| 14 |
+
# Download the model (SmolLM2-1.7B is perfect for fast CPU generation)
|
| 15 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; hf_hub_download(repo_id="bartowski/SmolLM2-1.7B-Instruct-GGUF", filename="SmolLM2-1.7B-Instruct-Q4_K_M.gguf", local_dir="/app")'
|
| 16 |
|
| 17 |
+
# Copy your application files
|
| 18 |
COPY app.py /app/app.py
|
| 19 |
COPY start.sh /app/start.sh
|
| 20 |
RUN chmod +x /app/start.sh
|
| 21 |
|
| 22 |
+
# Run the startup script
|
|
|
|
| 23 |
ENTRYPOINT ["/app/start.sh"]
|