Update Dockerfile
Browse files- Dockerfile +25 -46
Dockerfile
CHANGED
|
@@ -1,52 +1,31 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
RUN apt
|
| 7 |
-
apt-get install -y \
|
| 8 |
-
git \
|
| 9 |
-
build-essential \
|
| 10 |
-
cmake \
|
| 11 |
-
python3 \
|
| 12 |
-
python3-pip \
|
| 13 |
-
python3-venv \
|
| 14 |
-
curl && \
|
| 15 |
-
rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
#
|
| 18 |
RUN python3 -m venv /opt/venv
|
| 19 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN pip install -
|
| 23 |
-
|
| 24 |
-
#
|
| 25 |
-
RUN
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
# Download GGUF model
|
| 41 |
-
WORKDIR /app
|
| 42 |
-
|
| 43 |
-
RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='bartowski/Qwen2.5-Coder-1.5B-Instruct-GGUF', filename='Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf', local_dir='/app/model')"
|
| 44 |
-
|
| 45 |
-
EXPOSE 7860
|
| 46 |
-
|
| 47 |
-
CMD ["/app/llama.cpp/build/bin/llama-server", \
|
| 48 |
-
"-m", "/app/model/Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf", \
|
| 49 |
-
"--host", "0.0.0.0", \
|
| 50 |
-
"--port", "7860", \
|
| 51 |
-
"-c", "32768", \
|
| 52 |
-
"-ngl", "0"]
|
|
|
|
| 1 |
+
# Base image llama.cpp se hi le rahe hain
|
| 2 |
+
FROM ghcr.io/ggml-org/llama.cpp:full
|
| 3 |
|
| 4 |
+
WORKDIR /app
|
| 5 |
|
| 6 |
+
# System dependencies install karna
|
| 7 |
+
RUN apt update && apt install -y python3 python3-pip python3-venv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Virtual environment setup
|
| 10 |
RUN python3 -m venv /opt/venv
|
| 11 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 12 |
|
| 13 |
+
# Python tools install karna
|
| 14 |
+
RUN pip install -U pip huggingface_hub
|
| 15 |
+
|
| 16 |
+
# Model download karna (Qwen2.5-Coder-1.5B)
|
| 17 |
+
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 18 |
+
repo="bartowski/Qwen2.5-Coder-1.5B-Instruct-GGUF"; \
|
| 19 |
+
hf_hub_download(repo_id=repo, filename="Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf", local_dir="/app")'
|
| 20 |
+
|
| 21 |
+
# Server start karne ka command
|
| 22 |
+
# Humne mmproj hata diya hai taaki error na aaye
|
| 23 |
+
CMD ["--server", \
|
| 24 |
+
"-m", "/app/Qwen2.5-Coder-1.5B-Instruct-Q6_K.gguf", \
|
| 25 |
+
"--host", "0.0.0.0", \
|
| 26 |
+
"--port", "7860", \
|
| 27 |
+
"-t", "2", \
|
| 28 |
+
"--cache-type-k", "q8_0", \
|
| 29 |
+
"--cache-type-v", "iq4_nl", \
|
| 30 |
+
"-c", "32768", \
|
| 31 |
+
"-n", "38912"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|