catlove007 commited on
Commit
5b6000b
·
1 Parent(s): 9ff0a1f

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +239 -0
README.md ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
12
+
13
+ ## Model Details
14
+
15
+ ### Model Description
16
+
17
+ <!-- Provide a longer summary of what this model is. -->
18
+
19
+
20
+
21
+ - **Developed by:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+ ```
46
+ class custom_model(nn.Module):
47
+ def __init__(self, cfg):
48
+ super().__init__()
49
+ self.cfg = cfg
50
+ self.config = AutoConfig.from_pretrained(cfg.model, output_hidden_states = True)
51
+ self.config.hidden_dropout = 0.0
52
+ self.config.hidden_dropout_prob = 0.0
53
+ self.config.attention_dropout = 0.0
54
+ self.config.attention_probs_dropout_prob = 0.0
55
+ self.model = AutoModel.from_pretrained(cfg.model, config = self.config)
56
+ if self.cfg.gradient_checkpointing:
57
+ self.model.gradient_checkpointing_enable()
58
+ self.pool = MeanPooling()
59
+ self.fc = nn.Linear(self.config.hidden_size, 1)
60
+ self._init_weights(self.fc)
61
+ def _init_weights(self, module):
62
+ if isinstance(module, nn.Linear):
63
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
64
+ if module.bias is not None:
65
+ module.bias.data.zero_()
66
+ elif isinstance(module, nn.Embedding):
67
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
68
+ if module.padding_idx is not None:
69
+ module.weight.data[module.padding_idx].zero_()
70
+ elif isinstance(module, nn.LayerNorm):
71
+ module.bias.data.zero_()
72
+ module.weight.data.fill_(1.0)
73
+ def feature(self, inputs):
74
+ outputs = self.model(**inputs)
75
+ last_hidden_state = outputs.last_hidden_state
76
+ feature = self.pool(last_hidden_state, inputs['attention_mask'])
77
+ return feature
78
+ def forward(self, inputs):
79
+ feature = self.feature(inputs)
80
+ output = self.fc(feature)
81
+ return output
82
+ ```
83
+
84
+ ### Downstream Use [optional]
85
+
86
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
87
+
88
+ [More Information Needed]
89
+
90
+ ### Out-of-Scope Use
91
+
92
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
93
+
94
+ [More Information Needed]
95
+
96
+ ## Bias, Risks, and Limitations
97
+
98
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
99
+
100
+ [More Information Needed]
101
+
102
+ ### Recommendations
103
+
104
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
105
+
106
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
107
+
108
+ ## How to Get Started with the Model
109
+
110
+ Use the code below to get started with the model.
111
+
112
+ [More Information Needed]
113
+
114
+ ## Training Details
115
+
116
+ ### Training Data
117
+
118
+ <!-- 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. -->
119
+
120
+ [More Information Needed]
121
+
122
+ ### Training Procedure
123
+
124
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
125
+
126
+ #### Preprocessing [optional]
127
+
128
+ [More Information Needed]
129
+
130
+
131
+ #### Training Hyperparameters
132
+
133
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
134
+
135
+ #### Speeds, Sizes, Times [optional]
136
+
137
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Evaluation
142
+
143
+ <!-- This section describes the evaluation protocols and provides the results. -->
144
+
145
+ ### Testing Data, Factors & Metrics
146
+
147
+ #### Testing Data
148
+
149
+ <!-- This should link to a Data Card if possible. -->
150
+
151
+ [More Information Needed]
152
+
153
+ #### Factors
154
+
155
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
156
+
157
+ [More Information Needed]
158
+
159
+ #### Metrics
160
+
161
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
162
+
163
+ [More Information Needed]
164
+
165
+ ### Results
166
+
167
+ [More Information Needed]
168
+
169
+ #### Summary
170
+
171
+
172
+
173
+ ## Model Examination [optional]
174
+
175
+ <!-- Relevant interpretability work for the model goes here -->
176
+
177
+ [More Information Needed]
178
+
179
+ ## Environmental Impact
180
+
181
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
182
+
183
+ 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).
184
+
185
+ - **Hardware Type:** [More Information Needed]
186
+ - **Hours used:** [More Information Needed]
187
+ - **Cloud Provider:** [More Information Needed]
188
+ - **Compute Region:** [More Information Needed]
189
+ - **Carbon Emitted:** [More Information Needed]
190
+
191
+ ## Technical Specifications [optional]
192
+
193
+ ### Model Architecture and Objective
194
+
195
+ [More Information Needed]
196
+
197
+ ### Compute Infrastructure
198
+
199
+ [More Information Needed]
200
+
201
+ #### Hardware
202
+
203
+ [More Information Needed]
204
+
205
+ #### Software
206
+
207
+ [More Information Needed]
208
+
209
+ ## Citation [optional]
210
+
211
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
212
+
213
+ **BibTeX:**
214
+
215
+ [More Information Needed]
216
+
217
+ **APA:**
218
+
219
+ [More Information Needed]
220
+
221
+ ## Glossary [optional]
222
+
223
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
224
+
225
+ [More Information Needed]
226
+
227
+ ## More Information [optional]
228
+
229
+ [More Information Needed]
230
+
231
+ ## Model Card Authors [optional]
232
+
233
+ [More Information Needed]
234
+
235
+ ## Model Card Contact
236
+
237
+ [More Information Needed]
238
+
239
+