Team Ai
Apppublic

imperialwool/llama-cpp-api

sourceHugging Faceupdated 2y agoView on Hugging Face
2likes
Dockerfile38 linesDownload Raw Back to root
1# Loading base. I'm using Alpine, u can use whatever u want.2FROM python:3.11.9-alpine3.203 4# Just for sure everything will be fine.5# ALSO ITS BAD! But since its docker, probably.. screw it?6USER root7 8# Installing gcc compiler and main library.9RUN apk update && apk add wget build-base python3-dev musl-dev linux-headers10RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python11 12# Copying files into folder and making it working dir.13RUN mkdir app14COPY . /app15RUN chmod -R 777 /app16WORKDIR /app17 18# Making dir for translator model (facebook/m2m100_1.2B)19RUN mkdir translator20RUN chmod -R 777 translator21 22# Installing wget and downloading model.23ADD https://huggingface.co/Vikhrmodels/Vikhr-Qwen-2.5-1.5B-Instruct-GGUF/resolve/main/Vikhr-Qwen-2.5-1.5b-Instruct-Q4_1.gguf /app/model.bin24RUN chmod -R 777 /app/model.bin25# You can use other models! Or u can comment this two RUNs and include in Space/repo/Docker image own model with name "model.bin".26 27# Fixing warnings from Transformers and Matplotlib28RUN mkdir -p /.cache/huggingface/hub -m 77729RUN mkdir -p /.config/matplotlib -m 77730RUN chmod -R 777 /.cache 31RUN chmod -R 777 /.config32 33# Updating pip and installing everything from requirements34RUN python3 -m pip install -U pip setuptools wheel35RUN pip install --upgrade -r /app/requirements.txt36 37# Now it's time to run Gradio app!38CMD ["python", "gradio_app.py"]