Spaces:
Sleeping
Sleeping
File size: 909 Bytes
4023304 |
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 29 30 31 32 33 34 35 |
FROM python:3.11-slim
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN pip install --upgrade pip
# Copy requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install llama-cpp-python - try multiple repos in order
# First try jllllll's CPU wheels, then abetlen's
RUN pip install --no-cache-dir llama-cpp-python==0.2.85 \
--extra-index-url https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/basic/cpu \
|| pip install --no-cache-dir llama-cpp-python==0.2.85 \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|| pip install --no-cache-dir llama-cpp-python==0.2.85
# Copy application
COPY . .
# Expose port
EXPOSE 7860
# Run
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|