softltd-ai / Dockerfile
SoftLTD's picture
Update Dockerfile
2e8993f verified
Raw
History Blame Contribute Delete
1.47 kB
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
git \
build-essential \
cmake \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Сборка llama.cpp
RUN git clone https://github.com/ggerganov/llama.cpp /llama.cpp && \
cd /llama.cpp && \
mkdir build && \
cd build && \
cmake .. -DLLAMA_SERVER=ON && \
cmake --build . --config Release --target llama-server
RUN pip3 install huggingface_hub
# Скачивание модели (Q4_K_M)
RUN python3 -c "import os;from huggingface_hub import hf_hub_download,list_repo_files;repo='HauhauCS/Qwen3.5-9B-Uncensored-HauhauCS-Aggressive';target=[f for f in list_repo_files(repo) if 'Q4_K_M' in f][0];hf_hub_download(repo_id=repo,filename=target,local_dir='/',local_dir_use_symlinks=False);os.rename('/'+target,'/model.gguf')"
# Скачивание mmproj (медиа)
RUN python3 -c "import os;from huggingface_hub import hf_hub_download,list_repo_files;repo='HauhauCS/Qwen3.5-9B-Uncensored-HauhauCS-Aggressive';target=[f for f in list_repo_files(repo) if 'mmproj' in f][0];hf_hub_download(repo_id=repo,filename=target,local_dir='/',local_dir_use_symlinks=False);os.rename('/'+target,'/mmproj.gguf')"
ENV HOST=0.0.0.0
ENV PORT=7860
EXPOSE 7860
# Запуск llama-server
CMD ["/llama.cpp/build/bin/llama-server", "-m", "/model.gguf", "--mmproj", "/mmproj.gguf", "-c", "10000", "--host", "0.0.0.0", "--port", "7860", "-t", "2", "-tb", "2", "--cont-batching", "-np", "1"]