-
Install Required Packages:
Installed necessary libraries, including unsloth and kaggle.
-
Authentication:
Authenticated with Hugging Face Hub and Weights & Biases for tracking experiments and versioning.
-
Model Initialization:
Initialized the base model with 4-bit quantization and a sequence length of up to 2048 tokens.
-
Pre-Fine-Tuning Inference:
Conducted an initial inference to establish the model’s baseline performance on a medical question.
-
Dataset Preparation:
Structured and formatted the training data using a custom template tailored to medical CoT reasoning tasks.
-
Application of LoRA Adapters:
Incorporated LoRA adapters for efficient parameter tuning during fine-tuning.
-
Supervised Fine-Tuning:
Utilized SFTTrainer to fine-tune the model with optimized hyperparameters for 44 minutes.
-
Post-Fine-Tuning Inference:
Evaluated the model’s improved performance by testing it on the same medical question after fine-tuning.
-
Saving and Loading:
Stored the fine-tuned model, including LoRA adapters, for easy future use and deployment.
-
Model Deployment:
Pushed the fine-tuned model to Hugging Face Hub in GGUF format with 4-bit quantization enabled for efficient use.
Access the implementation notebook for this model
here. This notebook provides detailed steps for fine-tuning and deploying the model.