Spaces:
Runtime error
Runtime error
| # Hugging Face Spaces - Docker Runtime | |
| # Python 3.11 slim untuk kompatibilitas llama-cpp-python | |
| FROM python:3.11-slim | |
| # Build tools untuk llama-cpp-python (perlu kompilasi C++) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Salin requirements dulu (cache layer lebih efisien) | |
| COPY requirements.txt . | |
| # Install semua dependensi Python | |
| # Gunakan pre-built wheel CPU untuk llama-cpp-python agar build instan (tidak perlu compile 15 menit) | |
| RUN pip install --no-cache-dir --prefer-binary --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu -r requirements.txt | |
| # Salin seluruh kode | |
| COPY . . | |
| # Port default HF Spaces | |
| EXPOSE 7860 | |
| # Jalankan server | |
| CMD ["python", "-m", "serving.server"] | |