Chahnwoo commited on
Commit
717a80e
1 Parent(s): 4a95249

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +152 -1
README.md CHANGED
@@ -7,7 +7,6 @@ tags:
7
  - transformers
8
  - unsloth
9
  - llama
10
- - trl
11
  base_model: unsloth/llama-3-8b-bnb-4bit
12
  ---
13
 
@@ -20,3 +19,155 @@ base_model: unsloth/llama-3-8b-bnb-4bit
20
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
21
 
22
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  - transformers
8
  - unsloth
9
  - llama
 
10
  base_model: unsloth/llama-3-8b-bnb-4bit
11
  ---
12
 
 
19
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
20
 
21
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
22
+
23
+
24
+ # Model Card for Model ID
25
+
26
+ ## Model Details
27
+
28
+ ### Model Description
29
+
30
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
31
+
32
+ - **Developed by:** Andrew Chahnwoo Park
33
+ - **Model type:** LLaMA
34
+ - **Language(s) (NLP):** English
35
+ - **License:** apache-2.0
36
+ - **Finetuned from model:** [unsloth/llama-3-8b-bnb-4bit](https://huggingface.co/unsloth/llama-3-8b-bnb-4bit)
37
+
38
+ ### Model Sources
39
+
40
+ - **Repository:** [unsloth/llama-3-8b-bnb-4bit](https://huggingface.co/unsloth/llama-3-8b-bnb-4bit)
41
+ - **GitHub:** [Unsloth](https://github.com/unslothai/unsloth)
42
+
43
+
44
+ ## Training Details
45
+
46
+ ### Training Data
47
+
48
+ [DataBricks Instruction-Tuning Dataset](https://huggingface.co/datasets/databricks/databricks-dolly-15k) (10% utilized)
49
+
50
+ ### Training Procedure
51
+
52
+ 1. Tokenize and label data
53
+ 2. Load 4-bit quantized LLaMA-3 8B
54
+ 3. Apply Low-Rank Adaptation (QLoRA) to modules ["q_proj","k_proj","v_proj","o_proj"]
55
+ 4. Perform training with HuggingFace Trainer
56
+ 5. Use DataCollatorForSeq2Seq
57
+ - Note that this was data collator was chosen over the DataCollatorForLanguageModeling as the latter overwrites pre-defined "labels"
58
+ - This overwriting is done by the tf_mask_tokens and torch_mask_tokens functions for [DataCollatorForLanguageModeling](https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L634)
59
+
60
+ #### Preprocessing
61
+
62
+ Utilized different instruction prompt templates for each category in the dataset.
63
+
64
+ ##### open_qa
65
+ ### Instruction:
66
+ Answer the question below. Be as specific and concise as possible.
67
+
68
+ ### Question:
69
+ {instruction}
70
+
71
+ ### Response:
72
+ {response}
73
+
74
+ ##### general_qa
75
+ ### Instruction:
76
+ Answer the question below to the best of your konwledge.
77
+
78
+ ### Question:
79
+ {instruction}
80
+
81
+ ### Response:
82
+ {response}
83
+
84
+
85
+ ##### classification
86
+
87
+ ### Instruction:
88
+ You will be given a question and a list of potential answers to that question. You are to select the correct answers out of the available choices.
89
+
90
+ ### Question:
91
+ {instruction}
92
+
93
+ ### Response:
94
+ {response}
95
+
96
+ ##### closed_qa
97
+
98
+ ### Instruction:
99
+ You will be given a question to answer and context that contains pertinent information. Provide a concise and accurate response to the question using the information provided in the context.
100
+
101
+ ### Question:
102
+ {instruction}
103
+
104
+ ### Context:
105
+ {context}
106
+
107
+ ### Response:
108
+ {response}
109
+
110
+ ##### brainstorming
111
+
112
+ ### Instruction:
113
+ You will be given a question that does not have a correct answer. You are to brainstorm one possible answer to the provided question.
114
+
115
+ ### Question:
116
+ {instruction}
117
+
118
+ ### Response:
119
+ {response}
120
+
121
+ ##### information_extraction
122
+
123
+ ### Instruction:
124
+ You will be given a question or query and some context that can be used to answer it. You are to extract relevant information from the provided context to provide an accurate response to the given query.
125
+
126
+ ### Question:
127
+ {instruction}
128
+
129
+ ### Context:
130
+ {context}
131
+
132
+ ### Response:
133
+ {response}
134
+
135
+ ##### summarization
136
+
137
+ ### Instruction:
138
+ You will be given a question or request and context that can be used for your response. You are to summarize the provided context to provide an answer to the question.
139
+
140
+ ### Question:
141
+ {instruction}
142
+
143
+ ### Context:
144
+ {context}
145
+
146
+ ### Response:
147
+ {response}
148
+
149
+ ##### creative_writing
150
+
151
+ ### Instruction:
152
+ You will be given a prompt that you are to write about. Be creative.
153
+
154
+ ### Prompt:
155
+ {instruction}
156
+
157
+ ### Response:
158
+ {response}"""
159
+
160
+ #### Labelled Data Format
161
+
162
+ {
163
+ 'input_ids' : List[int],
164
+ 'attention_mask' : List[int],
165
+ 'labels' : List[int]
166
+ }
167
+
168
+ Where labels were created by masking everything but the "response" with the mask token (-100)
169
+
170
+ ### Hardware
171
+
172
+ Fine-tuning performed on Google Colab on a single session (T4).
173
+ Dataset not fully utilized due to limitations of free session.