Adapters
medical
Laurent1 commited on
Commit
032b543
1 Parent(s): c331808

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +118 -0
README.md ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ # For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
3
+ # Doc / guide: https://huggingface.co/docs/hub/model-cards
4
+ {}
5
+ ---
6
+
7
+ # Model Card for Model ID
8
+
9
+ <!-- Provide a quick summary of what the model is/does. -->
10
+
11
+ This model aims to provide a Question Answering model tuned with a short (128 tokens per row) Question Answering dataset
12
+ The dataset enables fine tuning in local with small HW, such as 1 GPU with 16 Go RAM
13
+
14
+
15
+ ## Model Details
16
+
17
+ The model has been dowloaded from ibm/mpt-7b-instruct2 (Apache 2.0 License.) and tuned with Supervised Fine-tuning Trainer and PEFT LoRa
18
+
19
+ ### Model Description
20
+
21
+
22
+
23
+ ### Model Sources [optional]
24
+
25
+ <!-- Provide the basic links for the model. -->
26
+
27
+ - **Repository:** [More Information Needed]
28
+ - **Paper [optional]:** [More Information Needed]
29
+ - **Demo [optional]:** [More Information Needed]
30
+
31
+
32
+ ### Direct Use
33
+
34
+ text = "Below is an instruction from Human. Write a response.\n ### Instruction:\n How to diagnose Parasites - Baylisascaris infection ?\n ### Response:"
35
+ inputs = tokenizer(text, return_tensors="pt").to('cuda')
36
+ out = model.generate(**inputs, max_new_tokens=100)
37
+
38
+ print(tokenizer.decode(out[0]))
39
+
40
+
41
+ ## Bias, Risks, and Limitations
42
+
43
+ In order to reduce training duration, the model has been trained only with the first 5100 rows of the 15500 rows dataset
44
+
45
+ ### Recommendations
46
+
47
+
48
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
49
+ Generation of plausible yet incorrect factual information, termed hallucination, is an unsolved issue in large language models.
50
+
51
+
52
+ ## How to Get Started with the Model
53
+
54
+ Use the code below to get started with the model.
55
+
56
+ ## Training Details
57
+
58
+ per_device_train_batch_size = 1
59
+ gradient_accumulation_steps = 16
60
+ epoch = 5
61
+
62
+ Step Training Loss
63
+ 64 1.618400
64
+ 128 1.084200
65
+ 192 1.021800
66
+ 256 1.014300
67
+ 320 0.960500
68
+ 384 0.905900
69
+ 448 0.885200
70
+ 512 0.847400
71
+ 576 0.889400
72
+ 640 0.861000
73
+ 704 0.800400
74
+ 768 0.768600
75
+ 832 0.750300
76
+ 896 0.780200
77
+ 960 0.762700
78
+ 1024 0.698600
79
+ 1088 0.672600
80
+ 1152 0.693100
81
+ 1216 0.708900
82
+ 1280 0.662700
83
+ 1344 0.630400
84
+ 1408 0.624600
85
+ 1472 0.627200
86
+ 1536 0.628000
87
+ 1600 0.603300
88
+
89
+ ### Training Data
90
+
91
+ Laurent1/MedQuad-MedicalQnADataset_128tokens_max
92
+
93
+ #### Preprocessing [optional]
94
+
95
+ Dataset already preprocessed (128 tokens max and truncated at a sentence end to keep meaning)
96
+
97
+
98
+ #### Training Hyperparameters
99
+
100
+
101
+ bnb_config = BitsAndBytesConfig(
102
+ load_in_4bit=True,
103
+ bnb_4bit_quant_type="nf4",
104
+ bnb_4bit_compute_dtype=torch.float16,
105
+ )
106
+
107
+ model = AutoModelForCausalLM.from_pretrained(
108
+ "ibm/mpt-7b-instruct2",
109
+ device_map="auto",
110
+ torch_dtype=torch.float16, #torch.bfloat16,
111
+ trust_remote_code=True
112
+ )
113
+
114
+ #### Speeds, Sizes, Times [optional]
115
+
116
+ Training :
117
+
118
+ 6287.4s - GPU T4 x2