Spaces:
Sleeping
Sleeping
Delete Dockerfile
#4
by Yakimask - opened
- Dockerfile +0 -33
Dockerfile
DELETED
|
@@ -1,33 +0,0 @@
|
|
| 1 |
-
# 1. 標準・軽量のDebian OS(正規品)
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
-
|
| 4 |
-
# 2. 【超重要】爆速並列コンパイルツール「ninja-build」と必須コンパイラを入れる
|
| 5 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
-
build-essential \
|
| 7 |
-
cmake \
|
| 8 |
-
ninja-build \
|
| 9 |
-
ca-certificates \
|
| 10 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
-
|
| 12 |
-
# 3. Hugging Faceの標準ルール(ユーザー権限設定)
|
| 13 |
-
RUN useradd -m -u 1000 user
|
| 14 |
-
WORKDIR /home/user/app
|
| 15 |
-
RUN chown user:user /home/user/app
|
| 16 |
-
|
| 17 |
-
USER user
|
| 18 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 19 |
-
|
| 20 |
-
# 4. pipの更新とHFツールの導入
|
| 21 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 22 |
-
RUN pip install --no-cache-dir huggingface_hub
|
| 23 |
-
|
| 24 |
-
# 5. 【大本命】Ninjaを使って爆速で自力ビルドする(30分はかかりません!2〜3分だけ待ってください!)
|
| 25 |
-
ENV CMAKE_GENERATOR=Ninja
|
| 26 |
-
RUN pip install --no-cache-dir "llama-cpp-python[server]"
|
| 27 |
-
|
| 28 |
-
# 6. ポート公開
|
| 29 |
-
EXPOSE 7860
|
| 30 |
-
|
| 31 |
-
# 7. サーバー起動(Qwen2.5-Coderをダウンロードして起動)
|
| 32 |
-
CMD python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF', filename='qwen2.5-coder-1.5b-instruct-q4_k_m.gguf', local_dir='./model')" && \
|
| 33 |
-
python -m llama_cpp.server --model ./model/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf --host 0.0.0.0 --port 7860 --n_ctx 2048 --n_threads 2 --chat_format chatml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|