| # Dockerfile.training β Dedicated GRPO Training HF Space | |
| # ========================================================== | |
| # Deploy this as a SEPARATE HF Space (hardware: A10G) to run | |
| # train_grpo_hf.py on the Space's GPU without touching the | |
| # production AEPO server Space. | |
| # | |
| # Create the training Space: | |
| # 1. huggingface.co β New Space | |
| # 2. Name: aepo-grpo-training | SDK: Docker | Hardware: A10G (24GB) | |
| # 3. Add secrets: HF_TOKEN, HF_REPO | |
| # 4. Upload this file as Dockerfile | |
| # 5. The Space will clone the AEPO repo, train, push the LoRA adapter, | |
| # then serve a status page so you can check progress. | |
| FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.11 python3.11-dev python3-pip git curl && \ | |
| ln -sf /usr/bin/python3.11 /usr/bin/python && \ | |
| apt-get clean && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # ββ Clone AEPO repo ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ARG REPO_URL=https://github.com/umeshmaurya1301/autonomous-enterprise-payment-orchestrator.git | |
| RUN git clone --depth 1 "${REPO_URL}" . | |
| # ββ Install AEPO runtime deps first (cached layer) ββββββββββββββββββββββββββββ | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| # ββ Install GRPO training extras ββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Unsloth nightly wheels for CUDA 12.1 β matches the nvidia/cuda base image. | |
| # xformers and flash-attn are optional; Unsloth falls back gracefully. | |
| RUN pip install \ | |
| "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git" \ | |
| "trl>=0.15.0" \ | |
| peft \ | |
| accelerate \ | |
| bitsandbytes \ | |
| datasets \ | |
| matplotlib \ | |
| huggingface_hub | |
| # ββ Training entrypoint βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Runs train_grpo_hf.py; after completion, starts a minimal HTTP server on | |
| # port 7860 that serves the results directory so the judge / user can | |
| # download grpo_reward_curve.png directly from the Space UI. | |
| COPY Dockerfile.training.entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| EXPOSE 7860 | |
| CMD ["/entrypoint.sh"] | |