This guide will help you fine-tune the Qwen3-Coder model (a Qwen-based language model optimized for code generation) to support the Amber programming language.
The goal is to train the model with hundreds of Amber scripting examples, enabling it to:
- Generate Amber code
- Convert Bash or Python scripts to Amber
This guide assumes basic knowledge of Linux, Python, and machine learning.
Fine-tuning a large model requires significant resources:
- CPU / RAM
- NVIDIA GPU (minimum 8GB VRAM, recommended 24GB+)
To reduce memory requirements, this guide uses PEFT (Parameter-Efficient Fine-Tuning) with LoRA.
No explanation needed
Run install.sh.
The previous script does it!
If authentication is required:
huggingface-cli login
Run:
source ./amber-finetune-env/bin/activate
./prepare_dataset.py /Amber/src/tests/stdlib/ /Amber/src/tests/translating/
Run training:
python train.py
Note: Training may take hours or days depending on dataset and GPU. Monitor with nvidia-smi or htop.
Run:
python test.py