Locutusque commited on
Commit
af28e3c
1 Parent(s): 5ed1e5c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +241 -0
README.md CHANGED
@@ -1,3 +1,244 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ datasets:
4
+ - Locutusque/InstructMix
5
+ language:
6
+ - en
7
+ metrics:
8
+ - bleu
9
+ - perplexity
10
+ pipeline_tag: text-generation
11
+ widget:
12
+ - text: '<|USER|> Design a Neo4j database and Cypher function snippet to Display Extreme Dental hygiene: Using Mouthwash for Analysis for Beginners. Implement if/else or switch/case statements to handle different conditions related to the Consent. Provide detailed comments explaining your control flow and the reasoning behind each decision. <|ASSISTANT|> '
13
  ---
14
+
15
+ # Model Card for Model ID
16
+
17
+ <!-- Provide a quick summary of what the model is/does. -->
18
+ This a fine-tuned version of gpt2 on Locutusque/InstructMix.
19
+
20
+ ## Model Details
21
+ This model performs significantly better than Locutusque/gpt2-conversational-or-qa. Here are the training results:
22
+
23
+
24
+ - BLEU - 26
25
+ - Perplexity - 12
26
+ ### Model Description
27
+
28
+ <!-- Provide a longer summary of what this model is. -->
29
+
30
+
31
+
32
+ - **Developed by:** Locutusque
33
+ - **Shared by [optional]:** [More Information Needed]
34
+ - **Model type:** GPT-2
35
+ - **Language(s) (NLP):** English
36
+ - **License:** [More Information Needed]
37
+ - **Finetuned from model [optional]:** GPT-2
38
+
39
+ ### Model Sources [optional]
40
+
41
+ <!-- Provide the basic links for the model. -->
42
+
43
+ - **Repository:** [More Information Needed]
44
+ - **Paper [optional]:** [More Information Needed]
45
+ - **Demo [optional]:** [More Information Needed]
46
+
47
+ ## Uses
48
+
49
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
50
+ This model is designed to follow instructions, or partake in conversations.
51
+
52
+ ### Direct Use
53
+
54
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
55
+
56
+ Instruction-following or conversational.
57
+
58
+ ### Downstream Use [optional]
59
+
60
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Out-of-Scope Use
65
+
66
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
67
+
68
+ [More Information Needed]
69
+
70
+ ## Bias, Risks, and Limitations
71
+
72
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
73
+
74
+ [More Information Needed]
75
+
76
+ ### Recommendations
77
+
78
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
79
+
80
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
81
+
82
+ ## How to Get Started with the Model
83
+
84
+ Use the code below to get started with the model.
85
+
86
+ ```python
87
+ import torch
88
+ from transformers import GPT2Tokenizer, GPT2LMHeadModel
89
+
90
+ tokenizer = GPT2Tokenizer.from_pretrained('gpt2-conversational-retrain')
91
+ model = GPT2LMHeadModel.from_pretrained('gpt2-conversational-retrain')
92
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
93
+ model.to(device)
94
+ def generate_text(model, tokenizer, prompt, max_length=1024):
95
+ prompt = f'<|USER|> {prompt} <|ASSISTANT|> '
96
+ input_ids = tokenizer.encode(prompt, add_special_tokens=True, return_tensors="pt").to(device)
97
+ attention_mask = torch.ones_like(input_ids).to(device)
98
+ output = model.generate(input_ids,
99
+ max_length=max_length,
100
+ do_sample=True,
101
+ temperature=0.3,
102
+ top_k=23,
103
+ top_p=0.7,
104
+ repetition_penalty=1.176,
105
+ pad_token_id=tokenizer.pad_token_id,
106
+ eos_token_id=tokenizer.eos_token_id,
107
+ attention_mask=attention_mask)
108
+ output_ids = tokenizer.decode(output[0], skip_special_tokens=False)
109
+ return output_ids
110
+ # Loop to interact with the model
111
+ while True:
112
+ prompt = input("Enter a prompt (or 'q' to quit): ")
113
+ if prompt == "q":
114
+ break
115
+ output_text = generate_text(model, tokenizer, prompt)
116
+ print(output_text)
117
+ ```
118
+
119
+ ## Training Details
120
+
121
+ ### Training Data
122
+
123
+ <!-- This should link to a Data 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. -->
124
+
125
+ https://huggingface.co/datasets/Locutusque/InstructMix
126
+
127
+ This model has so far been trained on 10% of the linked data, with more training sessions to come.
128
+
129
+ ### Training Procedure
130
+
131
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
132
+
133
+ #### Preprocessing [optional]
134
+
135
+ [More Information Needed]
136
+
137
+
138
+ #### Training Hyperparameters
139
+
140
+ - **Training regime:** fp16 non-mixed precision <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
141
+
142
+ #### Speeds, Sizes, Times [optional]
143
+
144
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
145
+
146
+ [More Information Needed]
147
+
148
+ ## Evaluation
149
+
150
+ <!-- This section describes the evaluation protocols and provides the results. -->
151
+
152
+ ### Testing Data, Factors & Metrics
153
+
154
+ #### Testing Data
155
+
156
+ <!-- This should link to a Data Card if possible. -->
157
+
158
+ [More Information Needed]
159
+
160
+ #### Factors
161
+
162
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
163
+
164
+ [More Information Needed]
165
+
166
+ #### Metrics
167
+
168
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
169
+
170
+ [More Information Needed]
171
+
172
+ ### Results
173
+
174
+ [More Information Needed]
175
+
176
+ #### Summary
177
+
178
+
179
+
180
+ ## Model Examination [optional]
181
+
182
+ <!-- Relevant interpretability work for the model goes here -->
183
+
184
+ [More Information Needed]
185
+
186
+ ## Environmental Impact
187
+
188
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
189
+
190
+ 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).
191
+
192
+ - **Hardware Type:** [More Information Needed]
193
+ - **Hours used:** [More Information Needed]
194
+ - **Cloud Provider:** [More Information Needed]
195
+ - **Compute Region:** [More Information Needed]
196
+ - **Carbon Emitted:** [More Information Needed]
197
+
198
+ ## Technical Specifications [optional]
199
+
200
+ ### Model Architecture and Objective
201
+
202
+ [More Information Needed]
203
+
204
+ ### Compute Infrastructure
205
+
206
+ [More Information Needed]
207
+
208
+ #### Hardware
209
+
210
+ [More Information Needed]
211
+
212
+ #### Software
213
+
214
+ [More Information Needed]
215
+
216
+ ## Citation [optional]
217
+
218
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
219
+
220
+ **BibTeX:**
221
+
222
+ [More Information Needed]
223
+
224
+ **APA:**
225
+
226
+ [More Information Needed]
227
+
228
+ ## Glossary [optional]
229
+
230
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
231
+
232
+ [More Information Needed]
233
+
234
+ ## More Information [optional]
235
+
236
+ [More Information Needed]
237
+
238
+ ## Model Card Authors [optional]
239
+
240
+ [More Information Needed]
241
+
242
+ ## Model Card Contact
243
+
244
+ [More Information Needed]