Yassinj commited on
Commit
eb395f8
verified
1 Parent(s): 4bf0f10

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -44
README.md CHANGED
@@ -7,6 +7,8 @@ base_model:
7
  pipeline_tag: question-answering
8
  ---
9
 
 
 
10
  ## Model Overview
11
  This model is a fine-tuned version of the LLaMA 3.1-8B model, trained on a curated selection of 1,122 samples from the **ChatDoctor (HealthCareMagic-100k)** dataset. It has been optimized for tasks related to medical consultations.
12
 
@@ -21,6 +23,12 @@ This model is designed to assist in:
21
  - Providing health-related advice
22
  - Assisting in basic diagnostic reasoning (non-clinical use)
23
 
 
 
 
 
 
 
24
  ## Model Details
25
  | **Feature** | **Details** |
26
  |------------------------------|----------------------------|
@@ -49,7 +57,7 @@ The model was fine-tuned with the following hyperparameters:
49
  Validation was performed using a separate subset of the dataset. The final training and validation loss are as follows:
50
 
51
  <p align="center">
52
- <img src="train-val-curve.png" alt="Training and Validation Loss" width="50%"/>
53
  </p>
54
 
55
  ## Evaluation Results
@@ -64,46 +72,28 @@ Validation was performed using a separate subset of the dataset. The final train
64
  - **ROUGE-L**: 0.1249
65
 
66
  ## Usage
67
- ### Loading the Model
68
- This model is hosted in **GGUF format** for optimal deployment. You can load and run the model using **LLaMA.cpp**.
69
-
70
- #### Steps to Use
71
- 1. Clone the LLaMA.cpp repository:
72
- ```bash
73
- git clone https://github.com/ggerganov/llama.cpp
74
- cd llama.cpp
75
- make
76
- ```
77
-
78
- 2. Download the model from Hugging Face:
79
- ```bash
80
- huggingface-cli login
81
- wget https://huggingface.co/your-username/llama-3.1-8B-gguf/resolve/main/output_model.gguf
82
- ```
83
-
84
- 3. Run inference:
85
- ```bash
86
- ./main -m output_model.gguf -p "What are the symptoms of a common cold?" -t 4 -n 100
87
- ```
88
-
89
- ### Quantization Details
90
- The model is quantized to **Q4_0** for faster inference while maintaining reasonable accuracy. You can run it efficiently on CPUs with low memory requirements.
91
-
92
- ## Limitations and Intended Use
93
- - **Not for Clinical Use**: This model is intended for educational purposes and general health advice. It should not replace professional medical consultation.
94
- - **Bias and Errors**: The model might exhibit biases present in the training data. Outputs should be interpreted with caution.
95
-
96
- ## Acknowledgments
97
- - **Dataset**: ChatDoctor (HealthCareMagic-100k)
98
- - **Base Model**: LLaMA 3.1-8B
99
- - **Quantization Tools**: LLaMA.cpp
100
-
101
- ## Citation
102
- If you use this model, please cite:
103
- ```
104
- @article{yourcitation,
105
- title={Fine-tuned LLaMA 3.1-8B on ChatDoctor Dataset},
106
- author={Your Name},
107
- year={2025},
108
- publisher={Hugging Face}
109
- }
 
7
  pipeline_tag: question-answering
8
  ---
9
 
10
+ # LLaMA 3.1-8B Fine-Tuned on ChatDoctor Dataset
11
+
12
  ## Model Overview
13
  This model is a fine-tuned version of the LLaMA 3.1-8B model, trained on a curated selection of 1,122 samples from the **ChatDoctor (HealthCareMagic-100k)** dataset. It has been optimized for tasks related to medical consultations.
14
 
 
23
  - Providing health-related advice
24
  - Assisting in basic diagnostic reasoning (non-clinical use)
25
 
26
+ ## Datasets
27
+ - **Training Data**: ChatDoctor-HealthCareMagic-100k
28
+ - **Training Set**: 900 samples
29
+ - **Validation Set**: 100 samples
30
+ - **Test Set**: 122 samples
31
+
32
  ## Model Details
33
  | **Feature** | **Details** |
34
  |------------------------------|----------------------------|
 
57
  Validation was performed using a separate subset of the dataset. The final training and validation loss are as follows:
58
 
59
  <p align="center">
60
+ <img src="train-val-curve.png" alt="Training and Validation Loss" width="35%"/>
61
  </p>
62
 
63
  ## Evaluation Results
 
72
  - **ROUGE-L**: 0.1249
73
 
74
  ## Usage
75
+ ```python
76
+ from transformers import AutoTokenizer, AutoModelForCausalLM
77
+ from bitsandbytes import BitsAndBytesConfig
78
+
79
+ model_id = "your-model-id"
80
+
81
+ # Load tokenizer
82
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
83
+ tokenizer.pad_token = tokenizer.eos_token
84
+
85
+ # Configure quantization
86
+ bnb_config = BitsAndBytesConfig(
87
+ load_in_4bit=True,
88
+ bnb_4bit_quant_type="nf4",
89
+ bnb_4bit_compute_dtype="float16",
90
+ bnb_4bit_use_double_quant=True
91
+ )
92
+
93
+ # Load model with quantization
94
+ model = AutoModelForCausalLM.from_pretrained(
95
+ model_id,
96
+ quantization_config=bnb_config,
97
+ device_map="auto"
98
+ )
99
+ ```