src/detector/
data.py load_data, tokenize_df
model.py build_model (LoRA), FocalLossTrainer, compute_metrics, ci95
train.py CONFIG + training loop (imports detector)
app.py Gradio demo UI
pyproject.toml makes `src/` importable via `pip install -e .`
pip install -e .
pip install -r requirements.txtpython train.py --smoke-test # sanity check, seconds
python train.py # full run: ModernBERT-large + LoRA, 3 seeds
cp -r output/best_model_seed42 saved_model
python app.py # Gradio UI, localhost:7860Edit locally in VS Code. Push to GitHub. Open colab_launcher.ipynb in Colab
(Runtime → GPU), update the clone URL, run all cells — trains on free T4.
LoRA r=64/α=128 (all-linear), focal loss γ=2.0, lr=1e-4, fp16 + gradient checkpointing, early stopping (patience=5), 3-seed 95% CI.