Downloads · 30 days
70
1% of all-time downloads
Nos-PT/Carvalho_pt-gl-1.3B
Carvalho_pt-gl-1.3B is a text generation model from Nos-PT. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Carvalhopt-gl-1.3B is a 1.3B-parameter transformer-based causal language model for Galician and European Portuguese. It is the result of a continual pretraining of a Cerebras-GPT-1.3B adapted to catalan, spanish and e…
Downloads · 30 days
70
1% of all-time downloads
All-time downloads
5.4K
Public
Parameters
1.3B
5.3 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin2.6 GB · 50%
From the Hugging Face model README
Carvalho_pt-gl-1.3B is a 1.3B-parameter transformer-based causal language model for Galician and European Portuguese. It is the result of a continual pretraining of a Cerebras-GPT-1.3B adapted to catalan, spanish and english previously by the AINA Project.
This model is part of the Carvalho familily, a family of LLMs specialized in Portuguese and Galician which can be found here.
import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
token_HF=""#Obter na páxina de HuggingFace
input_text = "Hoxe fai un bo día. O sol "
model_id = "Nos-PT/Carvalho_pt-gl-1.3B"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=token_HF)
model = AutoModelForCausalLM.from_pretrained(model_id, use_auth_token=token_HF)
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
generation = generator(
input_text,
do_sample=True,
top_k=10,
eos_token_id=tokenizer.eos_token_id
)
print(f"Result: {generation[0]['generated_text']}")
It was trained using HuggingFace Transformers and Pytorch, using the Causal Modeling Language script. We also use DeepSpeed to deal with the huge size of the model.
The training corpus consists of 5B tokens of texts in Galician and European Portuguese, whose main sources are CorpusNÓS for Galician and Arquivo.pt for Portuguese.
The training was conducted on the Galician Supercomputing Center (CESGA), using various nodes with 2 GPUs NVIDIA A100 40G.
The evaluation was carried out using the Calame dataset, in its Portuguese and Galician versions, and in the GLUE benchmark. In the latter case, the evaluated models were fine-tuned to rotate the tasks.
| Models | CALAME-GL | CALAME-PT |
|---|---|---|
| Carvalho_pt-gl 1.3B | 0.397 | 0.455 |
| GlorIA 1.3B | 0.219 | 0.488 |
| Gervasio-PTPT 7B | 0.265 | 0.434 |
| mGPT 1.3B | 0.264 | 0.425 |
| Bloom-1b1 | 0.262 | 0.456 |
| Cerebras-GPT 1.3B | 0.177 | 0.167 |
| Models | RTE | MRPC | STS-B | WNLI |
|---|---|---|---|---|
| Acc | F1 | Pearson | Acc | |
| Encoder-only | ||||
| AiBERTa Base | 55.3 | 83.2 | 80.2 | 58.9 |
| Albertina-PTPT 100m | 55.4 | 87.6 | 84.5 | 65.1 |
| Albertina-PTPT 900m | 80.6 | 89.8 | 88.7 | 65.1 |
| Albertina-PTPT 1.5B | 82.9 | 90.3 | 88.7 | 59.6 |
| Decoder-only | ||||
| Carvalho_pt-gl 1.3B | 68.0 | 86.0 | 82.6 | 65.1 |
| Gloria 1.3B | 63.8 | 85.2 | 82.0 | 65.1 |
| Gervásio 7B | 83.2 | 90.5 | 87.9 | 64.4 |
| Bloom 1.1B | 71.5 | 87.7 | 85.7 | 63.6 |
| mGPT 1.3B | 58.9 | 85.5 | 78.3 | 65.1 |
This model was development within the Nós Project, funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project ILENIA with reference 2022/TL22/00215336.
@inproceedings{gamallo2024galician,
title={A Galician-Portuguese Generative Model},
author={Gamallo, Pablo and Rodr{\'\i}guez, Pablo and Santos, Daniel and Sotelo, Susana and Miquelina, Nuno and Paniagua, Silvia and Schmidt, Daniela and de-Dios-Flores, Iria and Quaresma, Paulo and Bardanca, Daniel and others},
booktitle={EPIA Conference on Artificial Intelligence},
pages={292--304},
year={2024},
organization={Springer}
}