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:

  1. 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 of transformers last.

  2. Review or Edit the Training Script:
    Copy the script then open the bitnet_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.

  3. 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.

  4. Troubleshooting Tips:

    • If you’re running on a CPU-only machine, ensure the model is loaded in torch.float32 instead of torch.bfloat16.
    • Verify that your dataset paths and configurations match your local environment.

Enjoy fine-tuning your model locally!