tech-advisor / training /README.md
aslanconfig's picture
Initial commit: Tech Advisor fine-tuned on AWS DevOps Agent docs
975da6d
|
Raw
History Blame Contribute Delete
1.69 kB
# 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.