Spaces:
Sleeping
Sleeping
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
# you will also find guides on how best to write your Dockerfile | |
FROM python:3.10 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
WORKDIR /app | |
COPY --chown=user ./requirements.txt requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
COPY --chown=user . /app | |
USER root | |
RUN wget -qO- "https://github.com/Kitware/CMake/releases/download/v4.0.1/cmake-4.0.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local | |
USER user | |
RUN git clone https://github.com/ikawrakow/ik_llama.cpp.git | |
WORKDIR /app/ik_llama.cpp/ | |
RUN cmake -B build -DGGML_NATIVE=1 | |
RUN cmake --build build --config Release | |
WORKDIR /app/ik_llama.cpp/build/ | |
RUN wget https://huggingface.co/microsoft/bitnet-b1.58-2B-4T-gguf/resolve/9f43072f69492cbd5bc5d5ebb085fec519686a93/ggml-model-i2_s.gguf | |
RUN ./bin/llama-quantize --allow-requantize ./ggml-model-i2_s.gguf model-out.gguf iq2_bn | |
WORKDIR /app | |
CMD ["python", "chat_demo.py"] | |