Gemma-3-270M / Dockerfile
unknown
Fixed the model optimzation speed
e5ba726
raw
history blame contribute delete
879 Bytes
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
RUN apt-get update --allow-releaseinfo-change && \
apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt /app/requirements.txt
# Install Python dependencies
RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt
# Copy application code
COPY . /app
# Make start.sh executable
RUN chmod +x ./start.sh
# Environment defaults
ENV PORT=7860
ENV UVICORN_WORKERS=1
ENV MAX_CONCURRENT_REQUESTS=2
ENV MAX_WORKERS=2
ENV PORT=7860
ENV HF_TOKEN=""
# Performance optimizations for llama-cpp-python
ENV N_THREADS=4
ENV OMP_NUM_THREADS=4
EXPOSE 7860
CMD ["./start.sh"]