arthrod commited on
Commit
a4b1f52
·
0 Parent(s):

Initial commit

Browse files
.gitattributes ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ . filter=lfs diff=lfs merge=lfs -text
2
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
3
+ *.json filter=lfs diff=lfs merge=lfs -text
4
+ *.txt filter=lfs diff=lfs merge=lfs -text
5
+ *.bin filter=lfs diff=lfs merge=lfs -text
6
+ *.pt filter=lfs diff=lfs merge=lfs -text
7
+ *.pth filter=lfs diff=lfs merge=lfs -text
8
+ model.safetensors filter=lfs diff=lfs merge=lfs -text
9
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
10
+ merges.txt filter=lfs diff=lfs merge=lfs -text
11
+ vocab.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - pt
5
+ base_model:
6
+ - Qwen/Qwen2.5-0.5B-Instruct
7
+ pipeline_tag: text-generation
8
+ datasets:
9
+ - adalbertojunior/openHermes_portuguese
10
+ - cnmoro/smoltalk-555k-ptbr
11
+ - cnmoro/RagMixPTBR-Legal-Alpaca-2M
12
+ - adalbertojunior/dolphin-2.9-portuguese
13
+ model-index:
14
+ - name: Qwen2.5-0.5B-Portuguese-v2
15
+ results:
16
+ - task:
17
+ type: text-generation
18
+ name: Text Generation
19
+ dataset:
20
+ name: ENEM Challenge (No Images)
21
+ type: eduagarcia/enem_challenge
22
+ split: train
23
+ args:
24
+ num_few_shot: 3
25
+ metrics:
26
+ - type: acc
27
+ value: 36.81
28
+ name: accuracy
29
+ source:
30
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
31
+ name: Open Portuguese LLM Leaderboard
32
+ - task:
33
+ type: text-generation
34
+ name: Text Generation
35
+ dataset:
36
+ name: BLUEX (No Images)
37
+ type: eduagarcia-temp/BLUEX_without_images
38
+ split: train
39
+ args:
40
+ num_few_shot: 3
41
+ metrics:
42
+ - type: acc
43
+ value: 26.84
44
+ name: accuracy
45
+ source:
46
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
47
+ name: Open Portuguese LLM Leaderboard
48
+ - task:
49
+ type: text-generation
50
+ name: Text Generation
51
+ dataset:
52
+ name: OAB Exams
53
+ type: eduagarcia/oab_exams
54
+ split: train
55
+ args:
56
+ num_few_shot: 3
57
+ metrics:
58
+ - type: acc
59
+ value: 30.62
60
+ name: accuracy
61
+ source:
62
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
63
+ name: Open Portuguese LLM Leaderboard
64
+ - task:
65
+ type: text-generation
66
+ name: Text Generation
67
+ dataset:
68
+ name: Assin2 RTE
69
+ type: assin2
70
+ split: test
71
+ args:
72
+ num_few_shot: 15
73
+ metrics:
74
+ - type: f1_macro
75
+ value: 87.91
76
+ name: f1-macro
77
+ source:
78
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
79
+ name: Open Portuguese LLM Leaderboard
80
+ - task:
81
+ type: text-generation
82
+ name: Text Generation
83
+ dataset:
84
+ name: Assin2 STS
85
+ type: eduagarcia/portuguese_benchmark
86
+ split: test
87
+ args:
88
+ num_few_shot: 15
89
+ metrics:
90
+ - type: pearson
91
+ value: 59.01
92
+ name: pearson
93
+ source:
94
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
95
+ name: Open Portuguese LLM Leaderboard
96
+ - task:
97
+ type: text-generation
98
+ name: Text Generation
99
+ dataset:
100
+ name: FaQuAD NLI
101
+ type: ruanchaves/faquad-nli
102
+ split: test
103
+ args:
104
+ num_few_shot: 15
105
+ metrics:
106
+ - type: f1_macro
107
+ value: 43.97
108
+ name: f1-macro
109
+ source:
110
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
111
+ name: Open Portuguese LLM Leaderboard
112
+ - task:
113
+ type: text-generation
114
+ name: Text Generation
115
+ dataset:
116
+ name: HateBR Binary
117
+ type: ruanchaves/hatebr
118
+ split: test
119
+ args:
120
+ num_few_shot: 25
121
+ metrics:
122
+ - type: f1_macro
123
+ value: 33.62
124
+ name: f1-macro
125
+ source:
126
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
127
+ name: Open Portuguese LLM Leaderboard
128
+ - task:
129
+ type: text-generation
130
+ name: Text Generation
131
+ dataset:
132
+ name: PT Hate Speech Binary
133
+ type: hate_speech_portuguese
134
+ split: test
135
+ args:
136
+ num_few_shot: 25
137
+ metrics:
138
+ - type: f1_macro
139
+ value: 41.23
140
+ name: f1-macro
141
+ source:
142
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
143
+ name: Open Portuguese LLM Leaderboard
144
+ - task:
145
+ type: text-generation
146
+ name: Text Generation
147
+ dataset:
148
+ name: tweetSentBR
149
+ type: eduagarcia/tweetsentbr_fewshot
150
+ split: test
151
+ args:
152
+ num_few_shot: 25
153
+ metrics:
154
+ - type: f1_macro
155
+ value: 52.33
156
+ name: f1-macro
157
+ source:
158
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=cnmoro/Qwen2.5-0.5B-Portuguese-v2
159
+ name: Open Portuguese LLM Leaderboard
160
+ ---
161
+
162
+ Qwen2.5-0.5B finetuned for proficiency in Portuguese language and increased intelligence.
163
+
164
+ ```text
165
+ https://ollama.com/cnmoro/Qwen2.5-0.5B-Portuguese-v2
166
+ ```
167
+
168
+ ```python
169
+ from transformers import AutoModelForCausalLM, AutoTokenizer
170
+
171
+ model_name = "cnmoro/Qwen2.5-0.5B-Portuguese-v2"
172
+
173
+ model = AutoModelForCausalLM.from_pretrained(
174
+ model_name,
175
+ torch_dtype="auto",
176
+ device_map="auto"
177
+ )
178
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
179
+
180
+ prompt = "Escreva uma breve introdução sobre LLMs (Large Language Models) e suas aplicações."
181
+
182
+ # System prompt is always injected and hardcoded automatically
183
+ # for ideal performance in portuguese language.
184
+ # No need to write it again.
185
+ messages = [
186
+ {"role": "user", "content": prompt}
187
+ ]
188
+ text = tokenizer.apply_chat_template(
189
+ messages,
190
+ tokenize=False,
191
+ add_generation_prompt=True
192
+ )
193
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
194
+
195
+ generated_ids = model.generate(
196
+ **model_inputs,
197
+ max_new_tokens=512
198
+ )
199
+ generated_ids = [
200
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
201
+ ]
202
+
203
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
204
+ response
205
+ # As Large Language Models (LLMs) são sistemas computacionais projetados para produzir
206
+ # linguagem natural com alta precisão e fluência. Eles usam algoritmos avançados para compreender
207
+ # e gerar texto, permitindo-lhes realizar tarefas como tradução de idiomas, geração de conteúdo
208
+ # e processamento de linguagem natural.
209
+ #
210
+ # Os LLMs têm sido amplamente utilizados na área da inteligência artificial e do aprendizado
211
+ # de máquina há vários anos. Alguns dos principais usos de LLMs incluem:
212
+ #
213
+ # 1. Tradução automática: Os LLMs podem traduzir textos entre diferentes idiomas, tornando-os
214
+ # úteis em setores onde a comunicação internacional é crítica, como negócios internacionais,
215
+ # diplomacia ou relações públicas.
216
+ #
217
+ # 2. Geração de conteúdo: os LLMs podem criar conteúdo altamente personalizado e adaptado às
218
+ # necessidades específicas de seus usuários, tornando-os ideais para criação de sites, aplicativos
219
+ # móveis ou plataformas de mídia social.
220
+ #
221
+ # 3. Processamento de Linguagem Natural: Os LLMs podem ser treinados para reconhecer e compreender
222
+ # padrões de linguagem, permitindo-lhes compreender melhor as intenções humanas e responder adequadamente.
223
+ #
224
+ # 4. Análise de sentimento: Os LLMs podem analisar dados de texto e identificar sentimentos, ajudando
225
+ # a entender como as pessoas se sentem em relação a determinadas questões ou questões sociais.
226
+ #
227
+ # No geral, os LLMs estão se tornando cada vez mais importantes à medida que a tecnologia continua a
228
+ # avançar. À medida que continuamos a usar LLMs em nossas vidas diárias, podemos esperar ver ainda
229
+ # mais desenvolvimentos interessantes no futuro.
230
+ ```
231
+
232
+ ## Overall Results
233
+
234
+ | Task | Metric | Value | StdErr |
235
+ |---------------------------|---------------|---------|---------|
236
+ | ASSIN2 RTE | F1 Macro | 0.4486 | 0.0067 |
237
+ | ASSIN2 RTE | Accuracy | 0.5560 | 0.0071 |
238
+ | ASSIN2 STS | Pearson | 0.4091 | 0.0104 |
239
+ | ASSIN2 STS | MSE | 5.6395 | N/A |
240
+ | BluEX | Accuracy | 0.2503 | 0.0094 |
241
+ | ENEM Challenge | Accuracy | 0.3128 | 0.0071 |
242
+ | FAQUAD NLI | F1 Macro | 0.4611 | 0.0094 |
243
+ | FAQUAD NLI | Accuracy | 0.7877 | 0.0113 |
244
+ | HateBR Offensive (Binary) | F1 Macro | 0.3439 | 0.0049 |
245
+ | HateBR Offensive (Binary) | Accuracy | 0.4857 | 0.0095 |
246
+ | OAB Exams | Accuracy | 0.3062 | 0.0057 |
247
+ | Portuguese Hate Speech (Binary) | F1 Macro | 0.4119 | 0.0038 |
248
+ | Portuguese Hate Speech (Binary) | Accuracy | 0.7004 | 0.0111 |
249
+ | TweetSentBR | F1 Macro | 0.5055 | 0.0078 |
250
+ | TweetSentBR | Accuracy | 0.5697 | 0.0078 |
251
+
252
+ ## Detailed Results by Task
253
+
254
+ ### ASSIN2 RTE
255
+
256
+ | Metric | Value | StdErr |
257
+ |-------------|---------|---------|
258
+ | F1 Macro | 0.4486 | 0.0067 |
259
+ | Accuracy | 0.5560 | 0.0071 |
260
+
261
+ ### ASSIN2 STS
262
+
263
+ | Metric | Value | StdErr |
264
+ |-------------|---------|---------|
265
+ | Pearson | 0.4091 | 0.0104 |
266
+ | MSE | 5.6395 | N/A |
267
+
268
+ ### BluEX
269
+
270
+ | Exam ID | Metric | Value | StdErr |
271
+ |-------------------|----------|---------|---------|
272
+ | All | Accuracy | 0.2503 | 0.0094 |
273
+ | USP_2018 | Accuracy | 0.2037 | 0.0315 |
274
+ | UNICAMP_2018 | Accuracy | 0.1852 | 0.0306 |
275
+ | UNICAMP_2021_1 | Accuracy | 0.0870 | 0.0240 |
276
+ | USP_2020 | Accuracy | 0.2143 | 0.0317 |
277
+ | USP_2023 | Accuracy | 0.2045 | 0.0350 |
278
+ | UNICAMP_2019 | Accuracy | 0.2600 | 0.0358 |
279
+ | USP_2019 | Accuracy | 0.1500 | 0.0326 |
280
+ | UNICAMP_2020 | Accuracy | 0.2182 | 0.0321 |
281
+ | UNICAMP_2021_2 | Accuracy | 0.2941 | 0.0367 |
282
+ | UNICAMP_2023 | Accuracy | 0.4186 | 0.0433 |
283
+ | UNICAMP_2024 | Accuracy | 0.3111 | 0.0398 |
284
+ | USP_2024 | Accuracy | 0.2683 | 0.0398 |
285
+ | USP_2021 | Accuracy | 0.3269 | 0.0375 |
286
+ | UNICAMP_2022 | Accuracy | 0.3590 | 0.0444 |
287
+ | USP_2022 | Accuracy | 0.2857 | 0.0370 |
288
+
289
+ ### ENEM Challenge
290
+
291
+ | Exam ID | Metric | Value | StdErr |
292
+ |-----------|----------|---------|---------|
293
+ | All | Accuracy | 0.3128 | 0.0071 |
294
+ | 2017 | Accuracy | 0.2845 | 0.0241 |
295
+ | 2016 | Accuracy | 0.2479 | 0.0226 |
296
+ | 2016_2 | Accuracy | 0.2846 | 0.0235 |
297
+ | 2022 | Accuracy | 0.3534 | 0.0240 |
298
+ | 2012 | Accuracy | 0.3362 | 0.0253 |
299
+ | 2011 | Accuracy | 0.3333 | 0.0251 |
300
+ | 2010 | Accuracy | 0.3846 | 0.0260 |
301
+ | 2014 | Accuracy | 0.3211 | 0.0259 |
302
+ | 2009 | Accuracy | 0.2696 | 0.0239 |
303
+ | 2015 | Accuracy | 0.2521 | 0.0229 |
304
+ | 2023 | Accuracy | 0.3481 | 0.0236 |
305
+ | 2013 | Accuracy | 0.3333 | 0.0261 |
306
+
307
+ ### FAQUAD NLI
308
+
309
+ | Metric | Value | StdErr |
310
+ |-------------|---------|---------|
311
+ | F1 Macro | 0.4611 | 0.0094 |
312
+ | Accuracy | 0.7877 | 0.0113 |
313
+
314
+ ### HateBR Offensive (Binary)
315
+
316
+ | Metric | Value | StdErr |
317
+ |-------------|---------|---------|
318
+ | F1 Macro | 0.3439 | 0.0049 |
319
+ | Accuracy | 0.4857 | 0.0095 |
320
+
321
+ ### OAB Exams
322
+
323
+ | Exam ID | Metric | Value | StdErr |
324
+ |-------------|----------|---------|---------|
325
+ | All | Accuracy | 0.3062 | 0.0057 |
326
+ | 2011-05 | Accuracy | 0.3375 | 0.0304 |
327
+ | 2012-06a | Accuracy | 0.2625 | 0.0285 |
328
+ | 2010-02 | Accuracy | 0.3700 | 0.0279 |
329
+ | 2017-22 | Accuracy | 0.3500 | 0.0309 |
330
+ | 2016-20 | Accuracy | 0.3125 | 0.0300 |
331
+ | 2011-03 | Accuracy | 0.2626 | 0.0255 |
332
+ | 2015-17 | Accuracy | 0.3205 | 0.0304 |
333
+ | 2017-23 | Accuracy | 0.2875 | 0.0292 |
334
+ | 2018-25 | Accuracy | 0.3625 | 0.0311 |
335
+ | 2016-19 | Accuracy | 0.2436 | 0.0281 |
336
+ | 2017-24 | Accuracy | 0.1625 | 0.0238 |
337
+ | 2015-16 | Accuracy | 0.3125 | 0.0300 |
338
+ | 2011-04 | Accuracy | 0.3250 | 0.0301 |
339
+ | 2012-07 | Accuracy | 0.3500 | 0.0307 |
340
+ | 2012-06 | Accuracy | 0.1875 | 0.0253 |
341
+ | 2012-09 | Accuracy | 0.2468 | 0.0284 |
342
+ | 2013-12 | Accuracy | 0.3625 | 0.0311 |
343
+ | 2013-11 | Accuracy | 0.3000 | 0.0295 |
344
+ | 2010-01 | Accuracy | 0.3412 | 0.0296 |
345
+ | 2015-18 | Accuracy | 0.2875 | 0.0292 |
346
+ | 2014-13 | Accuracy | 0.3500 | 0.0308 |
347
+ | 2013-10 | Accuracy | 0.3125 | 0.0300 |
348
+ | 2016-20a | Accuracy | 0.2500 | 0.0279 |
349
+ | 2014-14 | Accuracy | 0.3125 | 0.0301 |
350
+ | 2012-08 | Accuracy | 0.3000 | 0.0296 |
351
+ | 2016-21 | Accuracy | 0.3375 | 0.0304 |
352
+ | 2014-15 | Accuracy | 0.4103 | 0.0321 |
353
+
354
+ ### Portuguese Hate Speech (Binary)
355
+
356
+ | Metric | Value | StdErr |
357
+ |-------------|---------|---------|
358
+ | F1 Macro | 0.4119 | 0.0038 |
359
+ | Accuracy | 0.7004 | 0.0111 |
360
+
361
+ ### TweetSentBR
362
+
363
+ | Metric | Value | StdErr |
364
+ |-------------|---------|---------|
365
+ | F1 Macro | 0.5055 | 0.0078 |
366
+ | Accuracy | 0.5697 | 0.0078 |
367
+
368
+
369
+ # Open Portuguese LLM Leaderboard Evaluation Results
370
+
371
+ Detailed results can be found [here](https://huggingface.co/datasets/eduagarcia-temp/llm_pt_leaderboard_raw_results/tree/main/cnmoro/Qwen2.5-0.5B-Portuguese-v2) and on the [🚀 Open Portuguese LLM Leaderboard](https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard)
372
+
373
+ | Metric | Value |
374
+ |--------------------------|---------|
375
+ |Average |**45.81**|
376
+ |ENEM Challenge (No Images)| 36.81|
377
+ |BLUEX (No Images) | 26.84|
378
+ |OAB Exams | 30.62|
379
+ |Assin2 RTE | 87.91|
380
+ |Assin2 STS | 59.01|
381
+ |FaQuAD NLI | 43.97|
382
+ |HateBR Binary | 33.62|
383
+ |PT Hate Speech Binary | 41.23|
384
+ |tweetSentBR | 52.33|
385
+
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:58b54bbe36fc752f79a24a271ef66a0a0830054b4dfad94bde757d851968060b
3
+ size 605
config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ec0029a9515af1dc458405263aed0750842354ee587d9bb1df9d87d7d89851f
3
+ size 798
generation_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24f1e3e711a9539eeec1435633da361563132fa616c1deb220999a0186b23eaa
3
+ size 265
merges.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
3
+ size 1671853
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d4b21d25f178426455f9b9ebe4b0b71869454e9b11b17e9d212c5ef93ae3ea2
3
+ size 988097824
special_tokens_map.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5acd1507cb3a3539e63369cb4a2b675a599cf13afe62282d371518288967797
3
+ size 614
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff9f6ae045c453341adf1a1e0f0b6f0b3ad00791215619ff8879d80db8570439
3
+ size 11421995
tokenizer_config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c07281296633779734a9c086a72d235dbdeb4d937f935a4c4e91a650f8c5565
3
+ size 7466
vocab.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
3
+ size 2776833