File size: 523 Bytes
b4a4eae b08827c b4a4eae 9ff47d9 b4a4eae | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | FROM python:3.10-slim
ENV HF_HOME=/tmp/hf_cache
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
ENV LLAMA_CPP_CACHE_DIR=/tmp/hf_cache
# Install system deps
RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . /app
# Install Python deps
RUN pip install --upgrade pip
RUN pip install --prefer-binary llama-cpp-python==0.2.90 fastapi uvicorn huggingface-hub transformers
# Expose FastAPI port
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|