nicholasKluge commited on
Commit
c792b4b
1 Parent(s): 8a0e964

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +173 -173
README.md CHANGED
@@ -1,173 +1,173 @@
1
- ---
2
- language:
3
- - pt
4
- license: apache-2.0
5
- library_name: transformers
6
- tags:
7
- - text-generation-inference
8
- datasets:
9
- - TucanoBR/GigaVerbo
10
- metrics:
11
- - perplexity
12
- pipeline_tag: text-generation
13
- widget:
14
- - text: "A floresta da Amazônia é conhecida por sua"
15
- example_title: Exemplo
16
- - text: "Uma das coisas que Portugal, Angola, Brasil e Moçambique tem em comum é o"
17
- example_title: Exemplo
18
- - text: "O Carnaval do Rio de Janeiro é"
19
- example_title: Exemplo
20
- inference:
21
- parameters:
22
- repetition_penalty: 1.2
23
- temperature: 0.2
24
- top_k: 20
25
- top_p: 0.2
26
- max_new_tokens: 150
27
- co2_eq_emissions:
28
- emissions: 350000
29
- source: CodeCarbon
30
- training_type: pre-training
31
- geographical_location: Germany
32
- hardware_used: NVIDIA A100-SXM4-80GB
33
- ---
34
- # Tucano-630m
35
-
36
- <img src="./logo.png" alt="An illustration of a Tucano bird showing vibrant colors like yellow, orange, blue, green, and black." height="200">
37
-
38
- ## Model Summary
39
-
40
- Tucano-1b1-Instruct is a fine-tuned version of [Tucano-1b1](https://huggingface.co/TucanoBR/Tucano-1b1). **[Tucano](https://huggingface.co/TucanoBR)** is a series of decoder-transformers based on the Llama 2 architecture, pretrained natively in Portuguese. All Tucano models were trained on **[GigaVerbo](https://huggingface.co/datasets/TucanoBR/GigaVerbo)**, a concatenation of deduplicated Portuguese text corpora amounting to 200 billion tokens.
41
-
42
- Read our preprint [here](https://arxiv.org/abs/xxxx.xxxxx).
43
-
44
- ## Details
45
-
46
- - **Architecture:** a Transformer-based model pre-trained via causal language modeling
47
- - **Size:** 630,253,568 parameters
48
- - **Context length:** 2048 tokens
49
- - **Dataset:** [TucanoBR/GigaVerbo](https://huggingface.co/datasets/TucanoBR/GigaVerbo)
50
- - **Language:** Portuguese
51
- - **Number of steps:** 400,000
52
- - **GPU:** 8 NVIDIA A100-SXM4-80GB
53
- - **Training time**: ~ 170 hours
54
- - **Emissions:** 350 KgCO2 (Germany)
55
- - **Total energy consumption:** 920 kWh
56
-
57
- This repository has the [source code](https://github.com/Nkluge-correa/Tucano) used to train this model. The main libraries used are:
58
-
59
- - [PyTorch](https://github.com/pytorch/pytorch)
60
- - [Transformers](https://github.com/huggingface/transformers)
61
- - [Datasets](https://github.com/huggingface/datasets)
62
- - [Tokenizers](https://github.com/huggingface/tokenizers)
63
- - [Sentencepiece](https://github.com/google/sentencepiece)
64
- - [Accelerate](https://github.com/huggingface/accelerate)
65
- - [FlashAttention](https://github.com/Dao-AILab/flash-attention)
66
- - [Liger Kernel](https://github.com/linkedin/Liger-Kernel)
67
- - [Codecarbon](https://github.com/mlco2/codecarbon)
68
-
69
- ## Intended Uses
70
-
71
- The primary intended use of the Tucano models is to serve as foundations for research and development involving native Portuguese language modeling. Checkpoints saved during training are designed to provide a controlled setting for performing comparative experiments, specifically regarding the effects of active pretraining on the performance of currently available benchmarks. You may also fine-tune and adapt Tucano models for deployment if your use follows the Apache 2.0 license. If you decide to use the Tucano models as a basis for your fine-tuned model, please conduct your own risk and bias assessment.
72
-
73
- ## Out-of-scope Use
74
-
75
- - Tucano models are **not intended for deployment**. They are not an out-of-the-box product and should not be used for human-facing interactions.
76
-
77
- - Tucano models are for **the Portuguese language only** and are unsuitable for text generation tasks in other languages.
78
-
79
- - Tucano models have **not been fine-tuned** for downstream tasks.
80
-
81
- ## Basic usage
82
-
83
- Using the `pipeline`:
84
-
85
- ```python
86
- from transformers import pipeline
87
-
88
- generator = pipeline("text-generation", model="TucanoBR/Tucano-630m")
89
-
90
- completions = generator("A floresta da Amazônia é conhecida por sua", num_return_sequences=2, max_new_tokens=100)
91
-
92
- for comp in completions:
93
- print(f"🤖 {comp['generated_text']}")
94
- ```
95
-
96
- Using the `AutoTokenizer` and `AutoModelForCausalLM`:
97
-
98
- ```python
99
- from transformers import AutoTokenizer, AutoModelForCausalLM
100
- import torch
101
-
102
- tokenizer = AutoTokenizer.from_pretrained("TucanoBR/Tucano-630m", revision='main')
103
- model = AutoModelForCausalLM.from_pretrained("TucanoBR/Tucano-630m", revision='main')
104
-
105
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
106
-
107
- model.eval()
108
- model.to(device)
109
-
110
- inputs = tokenizer("A floresta da Amazônia é conhecida por sua", return_tensors="pt").to(device)
111
-
112
- completions = model.generate(**inputs, num_return_sequences=2, max_new_tokens=100)
113
-
114
- for i, completion in enumerate(completions):
115
- print(f'🤖 {tokenizer.decode(completion)}')
116
- ```
117
-
118
- ## Limitations
119
-
120
- Like almost all other language models trained on large text datasets scraped from the web, the Tucano models show behavior that does not make them an out-of-the-box solution to many real-world applications, especially those requiring factual, reliable, and nontoxic text generation. Tucano models are all subject to the following:
121
-
122
- - **Hallucinations:** Tucano models can produce content that can be mistaken as true facts, but are misleading or entirely false, i.e., hallucination.
123
-
124
- - **Biases and Toxicity:** Tucano models inherit the social and historical stereotypes from the data used to train them. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.
125
-
126
- - **Unreliable Code:** Tucano models may produce incorrect code snippets and statements. These code generations should not be treated as suggestions or accurate solutions.
127
-
128
- - **Language Limitations:** Tucano models are primarily designed to interact with Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response.
129
-
130
- - **Repetition and Verbosity:** Tucano models may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.
131
-
132
- Hence, even though our models are released with a permissive license, we urge users to perform their risk analysis on them if they intend to use them for real-world applications. We also have humans moderating the outputs of these models in applications where they will interact with an audience, guaranteeing users are always aware they are interacting with a language model.
133
-
134
- ## Evaluations
135
-
136
- The table below compares our models against several Portuguese and multilingual language models on the evaluation harness used in our study. More information on it can be found [here](https://github.com/Nkluge-correa/Tucano/tree/main/evaluations/README.md). To learn more about our evaluation harness selection, [read our preprint](https://arxiv.org/abs/xxxx.xxxxx).
137
-
138
- | | Average | Calame-PT | Lambada-PT | Assin2 RTE | Assin2 STS | ARC-PT | HellaSwag-PT |
139
- |-------------------------|---------|-----------|------------|------------|------------|--------|--------------|
140
- | **Tucano-1b1** | 41.94 | 58.24 | 34.7 | 60.82 | 24.63 | 30.43 | 42.84 |
141
- | Llama-3.2-1B | 40.34 | 51.83 | 41.02 | 50.77 | 19.48 | 33.5 | 45.44 |
142
- | Bloom-1b1 | 36.95 | 52.94 | 30.22 | 54.32 | 14.64 | 29.83 | 39.74 |
143
- | Bloom-1b7 | 36.65 | 55.64 | 31.98 | 53.6 | 4.81 | 30.34 | 43.52 |
144
- | **Tucano-630m** | 36.29 | 56.55 | 33.13 | 57.79 | 1.99 | 28.89 | 39.41 |
145
- | Xglm-564m | 35.24 | 50.58 | 27.42 | 49.9 | 23.35 | 25.56 | 34.64 |
146
- | TTL-460m | 33.62 | 49.42 | 23.29 | 53.61 | 13 | 29.4 | 33 |
147
- | **Tucano-1b1-Instruct** | 33.19 | 56.74 | 34.66 | 33.42 | 0.87 | 30.6 | 42.83 |
148
- | **Tucano-160m** | 30.85 | 52.31 | 28.16 | 33.51 | 11.02 | 27.01 | 33.07 |
149
- | Bloom-560m | 29.85 | 49.95 | 25.44 | 33.33 | 8.48 | 24.74 | 37.15 |
150
- | TTL-160m | 29.56 | 46.72 | 20.98 | 53.97 | 0.24 | 26.15 | 29.29 |
151
- | GPorTuguese | 25.45 | 40.61 | 22.98 | 33.59 | 3.44 | 22.48 | 29.62 |
152
- | GlórIA-1b3 | 24.42 | 52.79 | 27.71 | 0 | 2.32 | 26.67 | 37.04 |
153
- | mGPT-1b3 | 21.3 | 47.14 | 29.92 | 0 | 0.58 | 23.81 | 26.37 |
154
- | Lola-v1 | 18.93 | 11.19 | 26.40 | 0 | 0 | 30.42 | 45.61 |
155
-
156
- ## Cite as 🤗
157
-
158
- ```latex
159
- @misc{correa24tucano,
160
- title = {{Tucano: Advancing Neural Text Generation for Portuguese}},
161
- author = {Corr{\^e}a, Nicholas Kluge and Sen, Aniket and Falk, Sophia and Fatimah, Shiza},
162
- journal={arXiv preprint arXiv:xxxx.xxxxx},
163
- year={2024}
164
- }
165
- ```
166
-
167
- ## Aknowlegments
168
-
169
- We gratefully acknowledge the granted access to the [Marvin cluster](https://www.hpc.uni-bonn.de/en/systems/marvin) hosted by [University of Bonn](https://www.uni-bonn.de/en) along with the support provided by its High Performance Computing \& Analytics Lab.
170
-
171
- ## License
172
-
173
- Tucano is licensed under the Apache License, Version 2.0. For more details, see the [LICENSE](LICENSE) file.
 
1
+ ---
2
+ language:
3
+ - pt
4
+ license: apache-2.0
5
+ library_name: transformers
6
+ tags:
7
+ - text-generation-inference
8
+ datasets:
9
+ - TucanoBR/GigaVerbo
10
+ metrics:
11
+ - perplexity
12
+ pipeline_tag: text-generation
13
+ widget:
14
+ - text: "A floresta da Amazônia é conhecida por sua"
15
+ example_title: Exemplo
16
+ - text: "Uma das coisas que Portugal, Angola, Brasil e Moçambique tem em comum é o"
17
+ example_title: Exemplo
18
+ - text: "O Carnaval do Rio de Janeiro é"
19
+ example_title: Exemplo
20
+ inference:
21
+ parameters:
22
+ repetition_penalty: 1.2
23
+ temperature: 0.2
24
+ top_k: 20
25
+ top_p: 0.2
26
+ max_new_tokens: 150
27
+ co2_eq_emissions:
28
+ emissions: 350000
29
+ source: CodeCarbon
30
+ training_type: pre-training
31
+ geographical_location: Germany
32
+ hardware_used: NVIDIA A100-SXM4-80GB
33
+ ---
34
+ # Tucano-630m
35
+
36
+ <img src="./logo.png" alt="An illustration of a Tucano bird showing vibrant colors like yellow, orange, blue, green, and black." height="200">
37
+
38
+ ## Model Summary
39
+
40
+ **[Tucano](https://huggingface.co/TucanoBR)** is a series of decoder-transformers based on the Llama 2 architecture, pretrained natively in Portuguese. All Tucano models were trained on **[GigaVerbo](https://huggingface.co/datasets/TucanoBR/GigaVerbo)**, a concatenation of deduplicated Portuguese text corpora amounting to 200 billion tokens.
41
+
42
+ Read our preprint [here](https://arxiv.org/abs/xxxx.xxxxx).
43
+
44
+ ## Details
45
+
46
+ - **Architecture:** a Transformer-based model pre-trained via causal language modeling
47
+ - **Size:** 630,253,568 parameters
48
+ - **Context length:** 2048 tokens
49
+ - **Dataset:** [TucanoBR/GigaVerbo](https://huggingface.co/datasets/TucanoBR/GigaVerbo)
50
+ - **Language:** Portuguese
51
+ - **Number of steps:** 400,000
52
+ - **GPU:** 8 NVIDIA A100-SXM4-80GB
53
+ - **Training time**: ~ 170 hours
54
+ - **Emissions:** 350 KgCO2 (Germany)
55
+ - **Total energy consumption:** 920 kWh
56
+
57
+ This repository has the [source code](https://github.com/Nkluge-correa/Tucano) used to train this model. The main libraries used are:
58
+
59
+ - [PyTorch](https://github.com/pytorch/pytorch)
60
+ - [Transformers](https://github.com/huggingface/transformers)
61
+ - [Datasets](https://github.com/huggingface/datasets)
62
+ - [Tokenizers](https://github.com/huggingface/tokenizers)
63
+ - [Sentencepiece](https://github.com/google/sentencepiece)
64
+ - [Accelerate](https://github.com/huggingface/accelerate)
65
+ - [FlashAttention](https://github.com/Dao-AILab/flash-attention)
66
+ - [Liger Kernel](https://github.com/linkedin/Liger-Kernel)
67
+ - [Codecarbon](https://github.com/mlco2/codecarbon)
68
+
69
+ ## Intended Uses
70
+
71
+ The primary intended use of the Tucano models is to serve as foundations for research and development involving native Portuguese language modeling. Checkpoints saved during training are designed to provide a controlled setting for performing comparative experiments, specifically regarding the effects of active pretraining on the performance of currently available benchmarks. You may also fine-tune and adapt Tucano models for deployment if your use follows the Apache 2.0 license. If you decide to use the Tucano models as a basis for your fine-tuned model, please conduct your own risk and bias assessment.
72
+
73
+ ## Out-of-scope Use
74
+
75
+ - Tucano models are **not intended for deployment**. They are not an out-of-the-box product and should not be used for human-facing interactions.
76
+
77
+ - Tucano models are for **the Portuguese language only** and are unsuitable for text generation tasks in other languages.
78
+
79
+ - Tucano models have **not been fine-tuned** for downstream tasks.
80
+
81
+ ## Basic usage
82
+
83
+ Using the `pipeline`:
84
+
85
+ ```python
86
+ from transformers import pipeline
87
+
88
+ generator = pipeline("text-generation", model="TucanoBR/Tucano-630m")
89
+
90
+ completions = generator("A floresta da Amazônia é conhecida por sua", num_return_sequences=2, max_new_tokens=100)
91
+
92
+ for comp in completions:
93
+ print(f"🤖 {comp['generated_text']}")
94
+ ```
95
+
96
+ Using the `AutoTokenizer` and `AutoModelForCausalLM`:
97
+
98
+ ```python
99
+ from transformers import AutoTokenizer, AutoModelForCausalLM
100
+ import torch
101
+
102
+ tokenizer = AutoTokenizer.from_pretrained("TucanoBR/Tucano-630m", revision='main')
103
+ model = AutoModelForCausalLM.from_pretrained("TucanoBR/Tucano-630m", revision='main')
104
+
105
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
106
+
107
+ model.eval()
108
+ model.to(device)
109
+
110
+ inputs = tokenizer("A floresta da Amazônia é conhecida por sua", return_tensors="pt").to(device)
111
+
112
+ completions = model.generate(**inputs, num_return_sequences=2, max_new_tokens=100)
113
+
114
+ for i, completion in enumerate(completions):
115
+ print(f'🤖 {tokenizer.decode(completion)}')
116
+ ```
117
+
118
+ ## Limitations
119
+
120
+ Like almost all other language models trained on large text datasets scraped from the web, the Tucano models show behavior that does not make them an out-of-the-box solution to many real-world applications, especially those requiring factual, reliable, and nontoxic text generation. Tucano models are all subject to the following:
121
+
122
+ - **Hallucinations:** Tucano models can produce content that can be mistaken as true facts, but are misleading or entirely false, i.e., hallucination.
123
+
124
+ - **Biases and Toxicity:** Tucano models inherit the social and historical stereotypes from the data used to train them. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.
125
+
126
+ - **Unreliable Code:** Tucano models may produce incorrect code snippets and statements. These code generations should not be treated as suggestions or accurate solutions.
127
+
128
+ - **Language Limitations:** Tucano models are primarily designed to interact with Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response.
129
+
130
+ - **Repetition and Verbosity:** Tucano models may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.
131
+
132
+ Hence, even though our models are released with a permissive license, we urge users to perform their risk analysis on them if they intend to use them for real-world applications. We also have humans moderating the outputs of these models in applications where they will interact with an audience, guaranteeing users are always aware they are interacting with a language model.
133
+
134
+ ## Evaluations
135
+
136
+ The table below compares our models against several Portuguese and multilingual language models on the evaluation harness used in our study. More information on it can be found [here](https://github.com/Nkluge-correa/Tucano/tree/main/evaluations/README.md). To learn more about our evaluation harness selection, [read our preprint](https://arxiv.org/abs/xxxx.xxxxx).
137
+
138
+ | | Average | Calame-PT | Lambada-PT | Assin2 RTE | Assin2 STS | ARC-PT | HellaSwag-PT |
139
+ |-------------------------|---------|-----------|------------|------------|------------|--------|--------------|
140
+ | **Tucano-1b1** | 41.94 | 58.24 | 34.7 | 60.82 | 24.63 | 30.43 | 42.84 |
141
+ | Llama-3.2-1B | 40.34 | 51.83 | 41.02 | 50.77 | 19.48 | 33.5 | 45.44 |
142
+ | Bloom-1b1 | 36.95 | 52.94 | 30.22 | 54.32 | 14.64 | 29.83 | 39.74 |
143
+ | Bloom-1b7 | 36.65 | 55.64 | 31.98 | 53.6 | 4.81 | 30.34 | 43.52 |
144
+ | **Tucano-630m** | 36.29 | 56.55 | 33.13 | 57.79 | 1.99 | 28.89 | 39.41 |
145
+ | Xglm-564m | 35.24 | 50.58 | 27.42 | 49.9 | 23.35 | 25.56 | 34.64 |
146
+ | TTL-460m | 33.62 | 49.42 | 23.29 | 53.61 | 13 | 29.4 | 33 |
147
+ | **Tucano-1b1-Instruct** | 33.19 | 56.74 | 34.66 | 33.42 | 0.87 | 30.6 | 42.83 |
148
+ | **Tucano-160m** | 30.85 | 52.31 | 28.16 | 33.51 | 11.02 | 27.01 | 33.07 |
149
+ | Bloom-560m | 29.85 | 49.95 | 25.44 | 33.33 | 8.48 | 24.74 | 37.15 |
150
+ | TTL-160m | 29.56 | 46.72 | 20.98 | 53.97 | 0.24 | 26.15 | 29.29 |
151
+ | GPorTuguese | 25.45 | 40.61 | 22.98 | 33.59 | 3.44 | 22.48 | 29.62 |
152
+ | GlórIA-1b3 | 24.42 | 52.79 | 27.71 | 0 | 2.32 | 26.67 | 37.04 |
153
+ | mGPT-1b3 | 21.3 | 47.14 | 29.92 | 0 | 0.58 | 23.81 | 26.37 |
154
+ | Lola-v1 | 18.93 | 11.19 | 26.40 | 0 | 0 | 30.42 | 45.61 |
155
+
156
+ ## Cite as 🤗
157
+
158
+ ```latex
159
+ @misc{correa24tucano,
160
+ title = {{Tucano: Advancing Neural Text Generation for Portuguese}},
161
+ author = {Corr{\^e}a, Nicholas Kluge and Sen, Aniket and Falk, Sophia and Fatimah, Shiza},
162
+ journal={arXiv preprint arXiv:xxxx.xxxxx},
163
+ year={2024}
164
+ }
165
+ ```
166
+
167
+ ## Aknowlegments
168
+
169
+ We gratefully acknowledge the granted access to the [Marvin cluster](https://www.hpc.uni-bonn.de/en/systems/marvin) hosted by [University of Bonn](https://www.uni-bonn.de/en) along with the support provided by its High Performance Computing \& Analytics Lab.
170
+
171
+ ## License
172
+
173
+ Tucano is licensed under the Apache License, Version 2.0. For more details, see the [LICENSE](LICENSE) file.