# Training Pipeline Fine-tune Nemotron Nano 12B v2 VL on AWS service documentation so the model has built-in knowledge of new/recent AWS services and features. ## Overview - **Base model**: `nvidia/NVIDIA-Nemotron-Nano-12B-v2-VL-BF16` - **Method**: QLoRA (4-bit quantization + LoRA adapters) - **Data**: AWS documentation converted to instruction-response pairs - **Target**: Push fine-tuned model to HF Hub for deployment ## Directory Structure ``` training/ ├── prepare_data.py # Convert raw docs → training JSONL ├── train.py # QLoRA fine-tuning script ├── push_to_hub.py # Merge adapter + push to HF Hub ├── requirements.txt # Training dependencies └── data/ ├── raw/ # Put AWS documentation markdown files here └── train.jsonl # Generated training data (output of prepare_data.py) ``` ## Steps ### 1. Gather AWS documentation Add markdown files to `training/data/raw/`. One file per service or feature: ``` training/data/raw/ ├── amazon-q.md ├── s3-express-one-zone.md ├── aurora-serverless-v2.md ├── bedrock.md └── ... ``` ### 2. Generate training data ```bash python training/prepare_data.py ``` This reads the raw docs and creates `training/data/train.jsonl` with instruction-response pairs. ### 3. Train on AWS (EC2 with GPU) ```bash pip install -r training/requirements.txt python training/train.py ``` Recommended: `g5.2xlarge` (A10G, 24GB VRAM) or `p3.2xlarge` (V100, 16GB). ### 4. Push to Hugging Face Hub ```bash python training/push_to_hub.py ``` ### 5. Update app.py Change `MODEL_ID` in `app.py` to point at your fine-tuned model.