Add tiny-random-EuroBertModel from hf-internal-testing

#1
by echarlaix HF Staff - opened
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +244 -0
  3. config.json +41 -0
  4. model.safetensors +3 -0
  5. tokenizer.json +3 -0
  6. tokenizer_config.json +19 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+ ### Code to create models
14
+
15
+ ```python
16
+ import torch
17
+
18
+ from transformers import (
19
+ AutoTokenizer,
20
+ EuroBertConfig,
21
+ EuroBertForMaskedLM,
22
+ EuroBertForSequenceClassification,
23
+ EuroBertForTokenClassification,
24
+ EuroBertModel,
25
+ )
26
+
27
+
28
+ classes = [
29
+ EuroBertForTokenClassification,
30
+ EuroBertModel,
31
+ EuroBertForMaskedLM,
32
+ EuroBertForSequenceClassification,
33
+ ]
34
+
35
+ for klass in classes:
36
+ model_id = "EuroBERT/EuroBERT-210m"
37
+ config = EuroBertConfig.from_pretrained(
38
+ model_id,
39
+ hidden_size=32,
40
+ intermediate_size=64,
41
+ num_hidden_layers=4,
42
+ num_attention_heads=2,
43
+ num_key_value_heads=2,
44
+ )
45
+ del config.auto_map # Avoid custom code loading
46
+
47
+ # Create model and randomize all weights
48
+ model = klass(config)
49
+
50
+ torch.manual_seed(0) # Set for reproducibility
51
+ for name, param in model.named_parameters():
52
+ param.data = torch.randn_like(param)
53
+
54
+ tokenizer = AutoTokenizer.from_pretrained(model_id, config=config)
55
+
56
+ model.push_to_hub(f"tiny-random-{klass.__name__}")
57
+ tokenizer.push_to_hub(f"tiny-random-{klass.__name__}")
58
+ ```
59
+ ### Model Description
60
+
61
+ <!-- Provide a longer summary of what this model is. -->
62
+
63
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
64
+
65
+ - **Developed by:** [More Information Needed]
66
+ - **Funded by [optional]:** [More Information Needed]
67
+ - **Shared by [optional]:** [More Information Needed]
68
+ - **Model type:** [More Information Needed]
69
+ - **Language(s) (NLP):** [More Information Needed]
70
+ - **License:** [More Information Needed]
71
+ - **Finetuned from model [optional]:** [More Information Needed]
72
+
73
+ ### Model Sources [optional]
74
+
75
+ <!-- Provide the basic links for the model. -->
76
+
77
+ - **Repository:** [More Information Needed]
78
+ - **Paper [optional]:** [More Information Needed]
79
+ - **Demo [optional]:** [More Information Needed]
80
+
81
+ ## Uses
82
+
83
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
84
+
85
+ ### Direct Use
86
+
87
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
88
+
89
+ [More Information Needed]
90
+
91
+ ### Downstream Use [optional]
92
+
93
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
94
+
95
+ [More Information Needed]
96
+
97
+ ### Out-of-Scope Use
98
+
99
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Bias, Risks, and Limitations
104
+
105
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
106
+
107
+ [More Information Needed]
108
+
109
+ ### Recommendations
110
+
111
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
112
+
113
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
114
+
115
+ ## How to Get Started with the Model
116
+
117
+ Use the code below to get started with the model.
118
+
119
+ [More Information Needed]
120
+
121
+ ## Training Details
122
+
123
+ ### Training Data
124
+
125
+ <!-- This should link to a Dataset 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. -->
126
+
127
+ [More Information Needed]
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:** [More Information Needed] <!--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 Dataset 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]
config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "EuroBertModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token": "<|begin_of_text|>",
8
+ "bos_token_id": 128000,
9
+ "classifier_pooling": "late",
10
+ "dtype": "float32",
11
+ "eos_token": "<|end_of_text|>",
12
+ "eos_token_id": 128001,
13
+ "head_dim": 64,
14
+ "hidden_act": "silu",
15
+ "hidden_dropout": 0.0,
16
+ "hidden_size": 32,
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 64,
19
+ "is_causal": false,
20
+ "is_decoder": false,
21
+ "mask_token": "<|mask|>",
22
+ "mask_token_id": 128002,
23
+ "max_position_embeddings": 8192,
24
+ "mlp_bias": false,
25
+ "model_type": "eurobert",
26
+ "num_attention_heads": 2,
27
+ "num_hidden_layers": 4,
28
+ "num_key_value_heads": 2,
29
+ "pad_token": "<|end_of_text|>",
30
+ "pad_token_id": 128001,
31
+ "pretraining_tp": 1,
32
+ "rms_norm_eps": 1e-05,
33
+ "rope_parameters": {
34
+ "rope_theta": 250000,
35
+ "rope_type": "default"
36
+ },
37
+ "tie_word_embeddings": false,
38
+ "transformers_version": "5.3.0.dev0",
39
+ "use_cache": false,
40
+ "vocab_size": 128256
41
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d833f0ff0acbce10e4edef3d5b9a6ab8bdbf7814f4387770182c6ad9c599d04a
3
+ size 16782224
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98d4a1d32152d6cedf85b5e88f3b205106dca1fe72aaab34e0ac13c238421069
3
+ size 17210235
tokenizer_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|end_of_text|>",
6
+ "is_local": false,
7
+ "mask_token": "<|mask|>",
8
+ "max_length": null,
9
+ "model_input_names": [
10
+ "input_ids",
11
+ "attention_mask"
12
+ ],
13
+ "model_max_length": 1000000000000000019884624838656,
14
+ "pad_to_multiple_of": null,
15
+ "pad_token": "<|pad|>",
16
+ "pad_token_type_id": 0,
17
+ "padding_side": "right",
18
+ "tokenizer_class": "TokenizersBackend"
19
+ }