Bitnet SFT Training Script Viewer & Tutorial
This app shows you Bifrost's SFT training script along with detailed instructions on how to run it locally or on a GPU space.
How to Run Bifrost's Bitnet SFT Training Script Locally
This Space shows you how to run the SFT fine-tuning training script on your own machine or on a GPU space.
Instructions:
Install Dependencies:
Ensure you have Python 3.10 or above. Install the required packages by running this in a requirements.txt:torch==2.6.0 pandas sympy scikit-learn==1.6.1 huggingface-hub beartype matplotlib==3.10.3 bitnet git+https://github.com/shumingma/transformers.git#egg=transformers
Your
requirements.txt
should include all necessary packages and install your custom GitHub fork oftransformers
last.Review or Edit the Training Script:
Copy the script then open thebitnet_sft_training.py
file (or whichever file contains the SFT training script) to review the code and adjust hyperparameters, file paths, or other settings as needed.Run the Script Locally:
From the terminal, execute:python bitnet_sft_training.py
This will start the fine-tuning process. Check your terminal for training loss logs and progress messages.
Troubleshooting Tips:
- If you’re running on a CPU-only machine, ensure the model is loaded in
torch.float32
instead oftorch.bfloat16
. - Verify that your dataset paths and configurations match your local environment.
- If you’re running on a CPU-only machine, ensure the model is loaded in
Enjoy fine-tuning your model locally!