This repository contains tools and scripts for fine-tuning Zamba2-1.2B-Instruct with a specific dataset. The implementation supports both single and multi-GPU training with automatic learning rate optimization.
git clone https://github.com/s-smits/finetune-zamba2.git
cd finetune-zamba2
export HF_TOKEN="your_token_here"
docker-compose up --build
git clone https://github.com/s-smits/finetune-zamba2.git
cd finetune-zamba2
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate
pip install -r requirements.txt
python finetune.py
The training configuration can be customized in finetune_config.py:
CONFIG = {
'model_name': "Zyphra/Zamba2-1.2B-instruct",
'context_window': 1024,
'batch_size': 4,
'gradient_accumulation_steps': 8,
'num_train_epochs': 1,
# ... other parameters
}
context_window: Maximum sequence length (default: 1024)batch_size: Training batch size per devicegradient_accumulation_steps: Number of steps to accumulate gradientsnum_train_epochs: Number of training epochslearning_rate: Learning rate (automatically optimized)weight_decay: Weight decay for AdamW optimizerfp16/bf16: Mixed precision training optionsThe default configuration uses the "BramVanroy/dolly-15k-dutch" dataset. To use your own data:
dataset_name in finetune_config.pydataset = Dataset.from_dict({
"text": [
"Your training example 1",
"Your training example 2",
# ...
]
})
The fine-tuned model will be saved in two locations:
./zamba2-finetuned/./zamba2-finetuned-final/Training progress can be monitored through:
CUDA Out of Memory
Training Too Slow
Docker Issues
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0.
This repository contains tools and scripts for fine-tuning Zamba2-1.2B-Instruct with a specific dataset. The implementation supports both single and multi-GPU training with automatic learning rate optimization.
git clone https://github.com/s-smits/finetune-zamba2.git
cd finetune-zamba2
export HF_TOKEN="your_token_here"
docker-compose up --build
git clone https://github.com/s-smits/finetune-zamba2.git
cd finetune-zamba2
python -m venv venv
source venv/bin/activate # For Windows: venv\Scripts\activate
pip install -r requirements.txt
python finetune.py
The training configuration can be customized in finetune_config.py:
CONFIG = {
'model_name': "Zyphra/Zamba2-1.2B-instruct",
'context_window': 1024,
'batch_size': 4,
'gradient_accumulation_steps': 8,
'num_train_epochs': 1,
# ... other parameters
}
context_window: Maximum sequence length (default: 1024)batch_size: Training batch size per devicegradient_accumulation_steps: Number of steps to accumulate gradientsnum_train_epochs: Number of training epochslearning_rate: Learning rate (automatically optimized)weight_decay: Weight decay for AdamW optimizerfp16/bf16: Mixed precision training optionsThe default configuration uses the "BramVanroy/dolly-15k-dutch" dataset. To use your own data:
dataset_name in finetune_config.pydataset = Dataset.from_dict({
"text": [
"Your training example 1",
"Your training example 2",
# ...
]
})
The fine-tuned model will be saved in two locations:
./zamba2-finetuned/./zamba2-finetuned-final/Training progress can be monitored through:
CUDA Out of Memory
Training Too Slow
Docker Issues
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0.