Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
@@ -11,12 +11,61 @@ language:
|
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
-
|
| 17 |
-
- **License:** apache-2.0
|
| 18 |
-
- **Finetuned from model :** unsloth/gemma-3-4b-it-unsloth-bnb-4bit
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: google/gemma-3-4b-it-unsloth-bnb-4bit
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
|
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# π§ Fine-Tuning Gemma 3B on Healthcare Admin Tasks
|
| 15 |
|
| 16 |
+
This repository demonstrates how to fine-tune the instruction-tuned [`google/gemma-3-4b-it`](https://huggingface.co/google/gemma-3-4b-it) model on a custom dataset covering administrative tasks in the healthcare industry.
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## π Project Overview
|
| 21 |
+
|
| 22 |
+
We use the [Unsloth](https://github.com/unslothai/unsloth) framework to:
|
| 23 |
+
- Load and quantize the base Gemma model in **4-bit precision**.
|
| 24 |
+
- Apply **LoRA (Low-Rank Adaptation)** for efficient parameter tuning.
|
| 25 |
+
- Train the model using Hugging Face's `trl` library and `SFTTrainer`.
|
| 26 |
+
|
| 27 |
+
This setup significantly reduces memory footprint and training cost, making it suitable for training on consumer GPUs (e.g. Colab, T4, A100).
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## π©Ί Dataset: Healthcare Admin
|
| 32 |
+
|
| 33 |
+
- **Source**: [`xgalaxy/healthcare_admin`](https://huggingface.co/datasets/xgalaxy/healthcare_admin)
|
| 34 |
+
- **Format**: ShareGPT-style JSON format with structured `user` and `assistant` roles
|
| 35 |
+
- **Coverage**:
|
| 36 |
+
- Appointment scheduling, cancellation, and rescheduling
|
| 37 |
+
- Edge cases involving follow-ups, missing info, and ambiguous requests
|
| 38 |
+
- Multi-turn conversations to emulate real-world interactions
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## π οΈ Key Components
|
| 43 |
+
|
| 44 |
+
### β
Model Setup
|
| 45 |
+
- `google/gemma-3-4b-it` loaded using Unsloth's `FastModel.from_pretrained()`
|
| 46 |
+
- 4-bit quantization enabled via `load_in_4bit=True`
|
| 47 |
+
- LoRA adapters injected for memory-efficient tuning
|
| 48 |
+
|
| 49 |
+
### β
Training
|
| 50 |
+
- Supervised fine-tuning with `SFTTrainer`
|
| 51 |
+
- Batch size simulated using `gradient_accumulation_steps`
|
| 52 |
+
- Linear learning rate scheduler with warmup
|
| 53 |
+
- Training capped at a fixed number of steps for fast iteration
|
| 54 |
+
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
## π Trained Model
|
| 58 |
+
|
| 59 |
+
The fine-tuned model is available on Hugging Face:
|
| 60 |
+
π [xgalaxy/gemma-3](https://huggingface.co/xgalaxy/gemma-3)
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## π Resources
|
| 65 |
+
|
| 66 |
+
- π [Unsloth GitHub](https://github.com/unslothai/unsloth)
|
| 67 |
+
- π [Gemma on Hugging Face](https://huggingface.co/google/gemma-3-4b-it)
|
| 68 |
+
- ποΈ [Healthcare Admin Dataset](https://huggingface.co/datasets/xgalaxy/healthcare_admin)
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
|
|
|