Nitishkumar-ai/commitguard-env
0
1# Use CUDA 12.1 base image2FROM nvidia/cuda:12.1.0-devel-ubuntu22.043 4# Avoid prompts5ENV DEBIAN_FRONTEND=noninteractive6 7# Install Python 3.11 and other essentials8RUN apt-get update && apt-get install -y \9 python3.11 \10 python3-pip \11 python3.11-dev \12 git \13 && rm -rf /var/lib/apt/lists/*14 15# Set python3.11 as default python16RUN ln -s /usr/bin/python3.11 /usr/bin/python17 18WORKDIR /app19 20# Upgrade pip21RUN pip install --no-cache-dir -U pip setuptools wheel22 23# Install PyTorch with CUDA 12.1 support24RUN pip install --no-cache-dir \25 torch==2.4.0 \26 triton \27 xformers \28 --index-url https://download.pytorch.org/whl/cu12129 30# Install Unsloth and let it resolve its own compatible TRL/PEFT stack.31RUN pip install --no-cache-dir \32 "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git" \33 datasets \34 wandb \35 matplotlib \36 fastapi \37 uvicorn \38 pydantic39 40# Copy the project files41COPY . .42 43# Install the local package in editable mode44RUN pip install -e .45 46# Make scripts executable47RUN chmod +x scripts/*.py48 49# Set environment variables50ENV MODEL_NAME="meta-llama/Llama-3.2-3B-Instruct"51ENV OUTPUT_DIR="outputs/commitguard-llama-3b-grpo"52ENV WANDB_PROJECT="commitguard"53 54# Default command: Run training and push to Hub55# Note: HF_TOKEN and WANDB_API_KEY should be set as Space Secrets56CMD ["python", "scripts/train_grpo.py", "--samples", "200", "--max-steps", "300", "--push-to-hub"]57 