Update README.md
Browse files
README.md
CHANGED
@@ -10,17 +10,10 @@ base_model:
|
|
10 |
---
|
11 |
|
12 |
# Model Card for Model ID
|
13 |
-
|
14 |
<!-- Provide a quick summary of what the model is/does. -->
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
## Model Details
|
19 |
-
|
20 |
### Model Description
|
21 |
-
|
22 |
<!-- Provide a longer summary of what this model is. -->
|
23 |
-
|
24 |
**Fine-Tuned Llama 3.1 3B Instruct with Medical Terms using QLoRA**
|
25 |
|
26 |
This is the model card of a π€ transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
@@ -39,17 +32,7 @@ The fine-tuning process involves using **QLoRA** to adapt the pre-trained model
|
|
39 |
- **Quantization:** 4-bit NF4 (Normal Float 4) Quantization
|
40 |
- **Hardware Used:** Consumer-grade GPU with 4-bit memory optimization
|
41 |
|
42 |
-
### Model Sources [optional]
|
43 |
-
|
44 |
-
<!-- Provide the basic links for the model. -->
|
45 |
-
|
46 |
-
- **Repository:** https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
|
47 |
-
- **Paper [optional]:** [More Information Needed]
|
48 |
-
- **Demo [optional]:** [More Information Needed]
|
49 |
-
|
50 |
-
|
51 |
## How to Get Started with the Model
|
52 |
-
|
53 |
Use the code below to get started with the model.
|
54 |
|
55 |
```python
|
@@ -69,25 +52,21 @@ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
|
69 |
```
|
70 |
|
71 |
## Training Details
|
72 |
-
|
73 |
### Training Data
|
74 |
-
|
75 |
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
76 |
-
|
77 |
The model has been fine-tuned on the **dmedhi/wiki_medical_terms** dataset. This dataset is designed to improve medical terminology comprehension and consists of:
|
78 |
|
79 |
β
Medical definitions and terminologies
|
|
|
80 |
β
Disease symptoms and conditions
|
|
|
81 |
β
Healthcare and clinical knowledge from Wikipedia's medical section
|
82 |
|
83 |
This dataset ensures that the fine-tuned model performs well in understanding and responding to medical queries with enhanced accuracy.
|
84 |
|
85 |
### Training Procedure
|
86 |
-
|
87 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
88 |
-
|
89 |
#### Preprocessing
|
90 |
-
|
91 |
- The dataset was cleaned and tokenized using the Llama 3.1 tokenizer, ensuring that medical terms were preserved.
|
92 |
|
93 |
- Special medical terminologies were handled properly to maintain context.
|
@@ -96,9 +75,6 @@ This dataset ensures that the fine-tuned model performs well in understanding an
|
|
96 |
|
97 |
|
98 |
#### Training Hyperparameters
|
99 |
-
|
100 |
-
- **Training regime:** <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
101 |
-
|
102 |
- **Training regime:** bf16 mixed precision (to balance efficiency and precision)
|
103 |
- **Batch Size:** 1 per device
|
104 |
- **Gradient Accumulation Steps:** 4 (to simulate a larger batch size)
|
@@ -111,9 +87,7 @@ This dataset ensures that the fine-tuned model performs well in understanding an
|
|
111 |
- **LoRA Dropout:** 0.05
|
112 |
|
113 |
#### Speeds, Sizes, Times
|
114 |
-
|
115 |
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
116 |
-
|
117 |
- **Training Hardware:** Single GPU (consumer-grade, VRAM-optimized)
|
118 |
- **Model Size after Fine-Tuning:** Approx. 3B parameters with LoRA adapters
|
119 |
- **Training Time:** ~3-4 hours per epoch on A100 40GB GPU
|
@@ -121,9 +95,7 @@ This dataset ensures that the fine-tuned model performs well in understanding an
|
|
121 |
|
122 |
|
123 |
## Environmental Impact
|
124 |
-
|
125 |
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
126 |
-
|
127 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
128 |
|
129 |
- **Hardware Type:** A100 40 GB GPU
|
@@ -133,25 +105,23 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
133 |
- **Carbon Emitted:** [More Information Needed]
|
134 |
|
135 |
## Limitations & Considerations
|
136 |
-
|
137 |
β Not a substitute for professional medical advice
|
138 |
β May contain biases from training data
|
139 |
β Limited knowledge scope (not updated in real-time)
|
140 |
|
141 |
## Citation
|
142 |
-
|
143 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
144 |
If you use this model, please consider citing:
|
145 |
-
|
146 |
@article{llama3.1_medical_qlora,
|
147 |
title={Fine-tuned Llama 3.1 3B Instruct for Medical Knowledge with QLoRA},
|
148 |
author={Karthik Manjunath Hadagali},
|
149 |
year={2024},
|
150 |
journal={Hugging Face Model Repository}
|
151 |
}
|
|
|
152 |
|
153 |
## Acknowledgments
|
154 |
-
|
155 |
- Meta AI for the Llama 3.1 3B Instruct Model.
|
156 |
- Hugging Face PEFT for QLoRA implementation.
|
157 |
- dmedhi/wiki_medical_terms dataset contributors.
|
|
|
10 |
---
|
11 |
|
12 |
# Model Card for Model ID
|
|
|
13 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
|
|
|
14 |
## Model Details
|
|
|
15 |
### Model Description
|
|
|
16 |
<!-- Provide a longer summary of what this model is. -->
|
|
|
17 |
**Fine-Tuned Llama 3.1 3B Instruct with Medical Terms using QLoRA**
|
18 |
|
19 |
This is the model card of a π€ transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
|
|
32 |
- **Quantization:** 4-bit NF4 (Normal Float 4) Quantization
|
33 |
- **Hardware Used:** Consumer-grade GPU with 4-bit memory optimization
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
## How to Get Started with the Model
|
|
|
36 |
Use the code below to get started with the model.
|
37 |
|
38 |
```python
|
|
|
52 |
```
|
53 |
|
54 |
## Training Details
|
|
|
55 |
### Training Data
|
|
|
56 |
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
|
|
57 |
The model has been fine-tuned on the **dmedhi/wiki_medical_terms** dataset. This dataset is designed to improve medical terminology comprehension and consists of:
|
58 |
|
59 |
β
Medical definitions and terminologies
|
60 |
+
|
61 |
β
Disease symptoms and conditions
|
62 |
+
|
63 |
β
Healthcare and clinical knowledge from Wikipedia's medical section
|
64 |
|
65 |
This dataset ensures that the fine-tuned model performs well in understanding and responding to medical queries with enhanced accuracy.
|
66 |
|
67 |
### Training Procedure
|
|
|
68 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
|
|
69 |
#### Preprocessing
|
|
|
70 |
- The dataset was cleaned and tokenized using the Llama 3.1 tokenizer, ensuring that medical terms were preserved.
|
71 |
|
72 |
- Special medical terminologies were handled properly to maintain context.
|
|
|
75 |
|
76 |
|
77 |
#### Training Hyperparameters
|
|
|
|
|
|
|
78 |
- **Training regime:** bf16 mixed precision (to balance efficiency and precision)
|
79 |
- **Batch Size:** 1 per device
|
80 |
- **Gradient Accumulation Steps:** 4 (to simulate a larger batch size)
|
|
|
87 |
- **LoRA Dropout:** 0.05
|
88 |
|
89 |
#### Speeds, Sizes, Times
|
|
|
90 |
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
|
|
91 |
- **Training Hardware:** Single GPU (consumer-grade, VRAM-optimized)
|
92 |
- **Model Size after Fine-Tuning:** Approx. 3B parameters with LoRA adapters
|
93 |
- **Training Time:** ~3-4 hours per epoch on A100 40GB GPU
|
|
|
95 |
|
96 |
|
97 |
## Environmental Impact
|
|
|
98 |
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
|
|
99 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
100 |
|
101 |
- **Hardware Type:** A100 40 GB GPU
|
|
|
105 |
- **Carbon Emitted:** [More Information Needed]
|
106 |
|
107 |
## Limitations & Considerations
|
|
|
108 |
β Not a substitute for professional medical advice
|
109 |
β May contain biases from training data
|
110 |
β Limited knowledge scope (not updated in real-time)
|
111 |
|
112 |
## Citation
|
|
|
113 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
114 |
If you use this model, please consider citing:
|
115 |
+
```bibtex
|
116 |
@article{llama3.1_medical_qlora,
|
117 |
title={Fine-tuned Llama 3.1 3B Instruct for Medical Knowledge with QLoRA},
|
118 |
author={Karthik Manjunath Hadagali},
|
119 |
year={2024},
|
120 |
journal={Hugging Face Model Repository}
|
121 |
}
|
122 |
+
```
|
123 |
|
124 |
## Acknowledgments
|
|
|
125 |
- Meta AI for the Llama 3.1 3B Instruct Model.
|
126 |
- Hugging Face PEFT for QLoRA implementation.
|
127 |
- dmedhi/wiki_medical_terms dataset contributors.
|