Skip to content

Fine-tuning Llama3 8b to generate JSON formats for arithmetic questions and process the output to perform calculations.

Notifications You must be signed in to change notification settings

yuki-2025/llama3-8b-fine-tuning-math

Repository files navigation

Fine-tuning Llama3 8b for Math

This project involves fine-tuning Llama3 8b to generate JSON formats for arithmetic questions and further post-process the output to perform calculations. This method incorporates the latest fine-tuning techniques such as Qlora, Unsloth, and PEFT. It enables faster training speeds and requires fewer computational resources.

PS: You need a T4 (16GB) GPU to run the code.

Colab Live code: https://drive.google.com/file/d/1NsSS1_M3pNAbkiBnPB3k5JKIkEQg3XNX/view?usp=sharing

Setup

  1. Download all the files in this repo.
  2. Run Load_model.py to load library and Llama3 8b.
  3. Run Prepare_data.py to load function_call.jsonl dataset and prepare dataset.
  4. Run Fine_tuning.py
  5. Run Inference_n_save.py to test the fine-tuned models and save the model.

Preview

Before Fine-tuning:

Test1:
Untitled design
Test2:
Untitled design
Test3:
Untitled design

After Fine-tuning:

Untitled design

This is part of my research study in The University of Chicago. The data is come from: https://github.com/rohanbalkondekar/finetune_llama2

About

Fine-tuning Llama3 8b to generate JSON formats for arithmetic questions and process the output to perform calculations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages