Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,190 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
|
|
|
|
|
|
|
|
3 |
tags:
|
4 |
-
-
|
|
|
|
|
5 |
- sft
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
---
|
7 |
|
8 |
-
# Model Card for Model
|
9 |
-
|
10 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
11 |
-
|
12 |
|
13 |
|
|
|
14 |
## Model Details
|
15 |
|
16 |
### Model Description
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
This is the model card of a 馃 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
21 |
-
|
22 |
-
- **Developed by:** [More Information Needed]
|
23 |
-
- **Funded by [optional]:** [More Information Needed]
|
24 |
-
- **Shared by [optional]:** [More Information Needed]
|
25 |
-
- **Model type:** [More Information Needed]
|
26 |
-
- **Language(s) (NLP):** [More Information Needed]
|
27 |
-
- **License:** [More Information Needed]
|
28 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
29 |
-
|
30 |
-
### Model Sources [optional]
|
31 |
-
|
32 |
-
<!-- Provide the basic links for the model. -->
|
33 |
-
|
34 |
-
- **Repository:** [More Information Needed]
|
35 |
-
- **Paper [optional]:** [More Information Needed]
|
36 |
-
- **Demo [optional]:** [More Information Needed]
|
37 |
-
|
38 |
-
## Uses
|
39 |
-
|
40 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
41 |
-
|
42 |
-
### Direct Use
|
43 |
-
|
44 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
45 |
-
|
46 |
-
[More Information Needed]
|
47 |
-
|
48 |
-
### Downstream Use [optional]
|
49 |
-
|
50 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
51 |
-
|
52 |
-
[More Information Needed]
|
53 |
-
|
54 |
-
### Out-of-Scope Use
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
63 |
-
|
64 |
-
[More Information Needed]
|
65 |
-
|
66 |
-
### Recommendations
|
67 |
-
|
68 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
69 |
-
|
70 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
71 |
-
|
72 |
-
## How to Get Started with the Model
|
73 |
-
|
74 |
-
Use the code below to get started with the model.
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
|
80 |
### Training Data
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
[More Information Needed]
|
85 |
-
|
86 |
-
### Training Procedure
|
87 |
-
|
88 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
89 |
-
|
90 |
-
#### Preprocessing [optional]
|
91 |
-
|
92 |
-
[More Information Needed]
|
93 |
-
|
94 |
-
|
95 |
-
#### Training Hyperparameters
|
96 |
|
97 |
-
-
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
-
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
### Testing Data, Factors & Metrics
|
110 |
-
|
111 |
-
#### Testing Data
|
112 |
-
|
113 |
-
<!-- This should link to a Dataset Card if possible. -->
|
114 |
-
|
115 |
-
[More Information Needed]
|
116 |
-
|
117 |
-
#### Factors
|
118 |
-
|
119 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
120 |
-
|
121 |
-
[More Information Needed]
|
122 |
-
|
123 |
-
#### Metrics
|
124 |
-
|
125 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
126 |
-
|
127 |
-
[More Information Needed]
|
128 |
-
|
129 |
-
### Results
|
130 |
-
|
131 |
-
[More Information Needed]
|
132 |
-
|
133 |
-
#### Summary
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
## Model Examination [optional]
|
138 |
-
|
139 |
-
<!-- Relevant interpretability work for the model goes here -->
|
140 |
-
|
141 |
-
[More Information Needed]
|
142 |
-
|
143 |
-
## Environmental Impact
|
144 |
-
|
145 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
146 |
-
|
147 |
-
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).
|
148 |
-
|
149 |
-
- **Hardware Type:** [More Information Needed]
|
150 |
-
- **Hours used:** [More Information Needed]
|
151 |
-
- **Cloud Provider:** [More Information Needed]
|
152 |
-
- **Compute Region:** [More Information Needed]
|
153 |
-
- **Carbon Emitted:** [More Information Needed]
|
154 |
-
|
155 |
-
## Technical Specifications [optional]
|
156 |
-
|
157 |
-
### Model Architecture and Objective
|
158 |
-
|
159 |
-
[More Information Needed]
|
160 |
-
|
161 |
-
### Compute Infrastructure
|
162 |
-
|
163 |
-
[More Information Needed]
|
164 |
-
|
165 |
-
#### Hardware
|
166 |
-
|
167 |
-
[More Information Needed]
|
168 |
-
|
169 |
-
#### Software
|
170 |
-
|
171 |
-
[More Information Needed]
|
172 |
|
173 |
-
|
174 |
|
175 |
-
|
|
|
|
|
|
|
176 |
|
177 |
-
|
178 |
|
179 |
-
|
180 |
|
181 |
-
**
|
|
|
|
|
|
|
|
|
182 |
|
183 |
-
[More Information Needed]
|
184 |
|
185 |
-
##
|
186 |
|
187 |
-
|
|
|
|
|
|
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
|
|
|
|
|
|
192 |
|
193 |
-
|
194 |
|
195 |
-
|
196 |
|
197 |
-
|
|
|
|
|
|
|
|
|
198 |
|
199 |
-
|
|
|
|
|
200 |
|
201 |
-
[
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
datasets:
|
4 |
+
- pauhidalgoo/patufet-conversa
|
5 |
+
language:
|
6 |
+
- ca
|
7 |
tags:
|
8 |
+
- catalan
|
9 |
+
- language-model
|
10 |
+
- transformer
|
11 |
- sft
|
12 |
+
model-index:
|
13 |
+
- name: cucafera-instruct
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: language-understanding
|
17 |
+
name: arc_ca_challenge
|
18 |
+
dataset:
|
19 |
+
name: arc_ca_challenge
|
20 |
+
type: catalan_bench
|
21 |
+
metrics:
|
22 |
+
- name: Accuracy
|
23 |
+
type: acc
|
24 |
+
value: 0.2295
|
25 |
+
- name: Normalized Accuracy
|
26 |
+
type: acc_norm
|
27 |
+
value: 0.2534
|
28 |
+
source:
|
29 |
+
name: Eleuther AI LM Evaluation Harness
|
30 |
+
url: https://github.com/EleutherAI/lm-evaluation-harness
|
31 |
+
- task:
|
32 |
+
type: language-understanding
|
33 |
+
name: arc_ca_easy
|
34 |
+
dataset:
|
35 |
+
name: arc_ca_easy
|
36 |
+
type: catalan_bench
|
37 |
+
metrics:
|
38 |
+
- name: Accuracy
|
39 |
+
type: acc
|
40 |
+
value: 0.4238
|
41 |
+
- name: Normalized Accuracy
|
42 |
+
type: acc_norm
|
43 |
+
value: 0.4108
|
44 |
+
source:
|
45 |
+
name: Eleuther AI LM Evaluation Harness
|
46 |
+
url: https://github.com/EleutherAI/lm-evaluation-harness
|
47 |
+
- task:
|
48 |
+
type: question-answering
|
49 |
+
name: catalanqa
|
50 |
+
dataset:
|
51 |
+
name: catalanqa
|
52 |
+
type: catalan_bench
|
53 |
+
metrics:
|
54 |
+
- name: Exact Match
|
55 |
+
type: exact_match
|
56 |
+
value: 0.0037
|
57 |
+
- name: F1 Score
|
58 |
+
type: f1
|
59 |
+
value: 0.0991
|
60 |
+
source:
|
61 |
+
name: Eleuther AI LM Evaluation Harness
|
62 |
+
url: https://github.com/EleutherAI/lm-evaluation-harness
|
63 |
+
- task:
|
64 |
+
type: language-understanding
|
65 |
+
name: copa_ca
|
66 |
+
dataset:
|
67 |
+
name: copa_ca
|
68 |
+
type: catalan_bench
|
69 |
+
metrics:
|
70 |
+
- name: Accuracy
|
71 |
+
type: acc
|
72 |
+
value: 0.614
|
73 |
+
source:
|
74 |
+
name: Eleuther AI LM Evaluation Harness
|
75 |
+
url: https://github.com/EleutherAI/lm-evaluation-harness
|
76 |
+
- task:
|
77 |
+
type: machine-translation
|
78 |
+
name: flores_ca
|
79 |
+
dataset:
|
80 |
+
name: flores_ca
|
81 |
+
type: flores
|
82 |
+
metrics:
|
83 |
+
- name: BLEU
|
84 |
+
type: bleu
|
85 |
+
value: 0.5934
|
86 |
+
source:
|
87 |
+
name: Eleuther AI LM Evaluation Harness
|
88 |
+
url: https://github.com/EleutherAI/lm-evaluation-harness
|
89 |
+
license: apache-2.0
|
90 |
+
base_model:
|
91 |
+
- pauhidalgoo/cucafera
|
92 |
+
- pauhidalgoo/cucafera-instruct
|
93 |
---
|
94 |
|
95 |
+
# Model Card for cucafera 馃敟馃惒 (Instruct Model)
|
|
|
|
|
|
|
96 |
|
97 |
|
98 |
+
This document describes **cucafera (Chat Model)**, a Catalan Large Language Model (LLM) fine-tuned to follow **multi-turn** instructions and generate text in Catalan. Built upon the instruct model, it uses a multi-turn dataset to enhance it's conversational capabilities.
|
99 |
## Model Details
|
100 |
|
101 |
### Model Description
|
102 |
|
103 |
+
**cucafera (Chat Model)** is a 244-million parameter transformer-based language model inspired by the LLAMA architecture (notably LLAMA3). Despite its relatively small size compared to many contemporary models, it is optimized for generating coherent and contextually relevant text in Catalan.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
+
- **Model Size:** 244M parameters
|
106 |
+
- **Architecture:** Transformer-based (LLAMA-inspired) with 30 layers
|
107 |
+
- **Embedding Size:** 768
|
108 |
+
- **Attention Mechanism:** 4 key/value heads and 8 query heads (using Grouped Query Attention - GQA)
|
109 |
+
- **Context Length:** 2048 tokens
|
110 |
+
- **Tokenizer:** Byte-Pair Encoding (BPE) with a vocabulary size of 65,536
|
111 |
+
- **Activation Function:** GeGLU
|
112 |
|
113 |
+
## Chat Fine-Tuning
|
114 |
|
115 |
+
The chat version of **cucafera** has been fine-tuned on top of the instruct version of cucafera. It follows the ChatML format for conversation, for example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
```
|
118 |
+
<|im_start|>user Fes un poema <|im_end|> <|im_start|>assistant
|
119 |
+
```
|
120 |
|
121 |
### Training Data
|
122 |
|
123 |
+
The base model was pre-trained using the [patufet-pretrain](https://huggingface.co/datasets/pauhidalgoo/patufet-pretrain) dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
The fine-tuning data utilized a mix of instruction datasets from the [patufet](https://huggingface.co/collections/pauhidalgoo/patufet-66ca6dd3888e99a28dd616ae) collection.
|
126 |
|
127 |
+
The chat data consists in the [patufet-conversa](https://huggingface.co/datasets/pauhidalgoo/patufet-conversa) dataset.
|
128 |
|
129 |
+
### Fine-tunning Procedure
|
130 |
|
131 |
+
The model was fine-tuned with the following setup:
|
132 |
+
- **Total fine-tunning steps:** 8400
|
133 |
+
- **Per device train batch size:** 1
|
134 |
+
- **Sequence Length:** 2048
|
135 |
+
- **Learning rate:** 3e-5
|
136 |
+
- **Optimizer:** AdamW
|
137 |
+
- **Weight decay:** 0.01
|
138 |
+
- **Epochs**: 3
|
139 |
|
140 |
+
Different commits represent different fine-tunning procedures: we experimented with different data mixes, epochs, datasets...
|
141 |
|
142 |
+
### Direct Use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
+
The cucafera (Chat Model) is designed for:
|
145 |
|
146 |
+
- **Multi-turn** Conversational agents and chatbots in Catalan.
|
147 |
+
- Task-specific applications such as summarization, translation (within Catalan), and creative writing.
|
148 |
+
- Educational and experimental research into instruction-following LLMs.
|
149 |
+
- Creative content generation, like poems or stories
|
150 |
|
151 |
+
However, due to its limited size, it is not able to provide correct factual information and you must be aware of this fact when using this model.
|
152 |
|
153 |
+
### Out-of-Scope Uses
|
154 |
|
155 |
+
- **High-Stakes Applications:**
|
156 |
+
The model is not recommended for uses where extremely high factual accuracy is required or where outputs could have significant real-world consequences.
|
157 |
+
- **Non-Catalan Tasks:**
|
158 |
+
Since the model is exclusively trained on Catalan text, it is not suited for tasks in other languages without further training or fine-tuning.
|
159 |
+
- **Sensitive or safety-critical uses:** It has not undergone RLHF/DPO tuning, so outputs should be reviewed carefully.
|
160 |
|
|
|
161 |
|
162 |
+
## Bias, Risks, and Limitations
|
163 |
|
164 |
+
- The model has **no instruction tuning**, so it may not follow prompts effectively.
|
165 |
+
- It **only understands Catalan**, meaning it is unsuitable for multilingual applications.
|
166 |
+
- Due to its **small size (244M parameters)**, its knowledge and reasoning capabilities are limited.
|
167 |
+
- It was trained on **a limited dataset**, which may introduce biases in its outputs.
|
168 |
|
169 |
+
### Recommendations
|
170 |
|
171 |
+
- The goal of this model is educational. You are encouraged to train your own model.
|
172 |
+
- If used in production, **human review** of its outputs is recommended.
|
173 |
+
- Fine-tuning on task-specific data can **improve accuracy** and **mitigate biases**.
|
174 |
+
- Users should be cautious when using it in **sensitive or high-stakes applications**.
|
175 |
|
176 |
+
## Use the Chat Model
|
177 |
|
178 |
+
You can use the chat model via huggingface's transformers library. Make sure to specify the **ChatML format**.
|
179 |
|
180 |
+
```
|
181 |
+
<|im_start|>user
|
182 |
+
Qu猫 茅s la intel路lig猫ncia artificial? <|im_end|>
|
183 |
+
<|im_start|>assistant', 'content': "Ets un assistent d'intel路lig猫ncia artificial que pot ajudar els usuaris amb problemes matem脿tics, especialment amb equacions."}, {'role': 'user', 'content': "Hola! M'agradaria aprendre m茅s sobre les equacions algebraiques. Pots explicar-me com funcionen?"}, {'role': 'assistant', 'content': "Hola! Les equacions algebraiques s贸n una forma de resoldre problemes geom猫trics complexos, on cada element t茅 un valor definit. Per exemple, si tenim l'equaci贸: (x + 1) / 2 = 10, el resultat ser脿 5 i el seu valor
|
184 |
+
```
|
185 |
|
186 |
+
### Acknowledgements
|
187 |
+
This model was developed as an experimental project, inspired by Karpathy's [NanoGPT Series](https://github.com/karpathy/nanoGPT).
|
188 |
+
My colleague [Roger Baiges](https://huggingface.co/baiges) also trained his own [CatGPT](https://huggingface.co/baiges/CatGPT).
|
189 |
|
190 |
+
For more details, updates, or to contribute to the project, please visit the [GitHub repository](https://github.com/pauhidalgoo/cucafera)
|