File size: 812 Bytes
714655c cc9ef29 5dd06f1 cc9ef29 61055e8 cc9ef29 61055e8 5dd06f1 714655c cc9ef29 714655c cc9ef29 714655c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/data/.huggingface \
TRANSFORMERS_CACHE=/data/.cache/huggingface \
HF_HUB_ENABLE_HF_TRANSFER=1 \
TOKENIZERS_PARALLELISM=false
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc g++ make cmake git \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Pre-built llama-cpp-python wheel with OpenBLAS
RUN pip install --no-cache-dir \
https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |