Spaces:
Sleeping
Sleeping
| # Use NVIDIA CUDA base image with Python support | |
| FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04 | |
| # Set working directory | |
| WORKDIR /app | |
| # Install Python and system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| python3.10 \ | |
| python3-pip \ | |
| python3.10-venv \ | |
| git \ | |
| curl \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Make python3.10 the default | |
| RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 | |
| # Upgrade pip | |
| RUN pip install --upgrade pip | |
| # ✅ Install prebuilt llama-cpp-python CUDA wheel (cu121) | |
| RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121 | |
| # Copy requirements.txt and install remaining dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY . . | |
| # Create models directory | |
| RUN mkdir -p models | |
| # Expose Gradio or web port | |
| EXPOSE 7860 | |
| # Gradio settings | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| ENV GRADIO_SERVER_PORT=7860 | |
| # Start app | |
| CMD ["python", "app.py"] | |