jellewas/gdpr-lora-v2train
0
LoRA Training Pipeline
Train a LoRA adapter (CPT + SFT) on a HuggingFace dataset using Unsloth and push the merged model to a HuggingFace repository. Runs on GPU-enabled HuggingFace Spaces.
Setup
Required Secrets
Set these as Space secrets (Settings > Repository secrets):
Optional Secrets
Training Hyperparameters (Environment Variables)
All have sensible defaults. Override via Space secrets or env vars.
Training Data Format
Your DATA_REPO dataset should contain these JSONL files:
- `corpus.jsonl` (or
cpt.jsonl/pretrain.jsonl) — For continued pre-training. Each line:{"text": "..."}. If absent, CPT is skipped. - `train.jsonl` — SFT training data. Each line:
{"text": "..."}(chat-formatted). - `val.jsonl` (or
validation.jsonl) — SFT validation data. Same format as train.
Workflow
- Create a HuggingFace Space with Docker SDK and a GPU runtime (T4 or better).
- Set the required secrets listed above.
- The Space builds and launches the Gradio UI.
- Click Start Training to begin the pipeline.
- Monitor progress in the log panel — it auto-refreshes every 5 seconds.
- When complete, the merged model is available at your
MODEL_REPO.
Pipeline Steps
- Download training data from
DATA_REPO - Run CPT (continued pre-training) if corpus file is present
- Run SFT (supervised fine-tuning) with CPT adapter merged in
- Merge all adapters into the base model
- Upload merged model to
MODEL_REPO - Optionally convert to GGUF and upload (requires llama.cpp in the image)
