Downloads · 30 days
11
2% of all-time downloads
Nos-PT/Llama-Carvalho-GL
Llama-Carvalho-GL 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 llama3.1.
<details <summaryClick to expand</summary
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
589
Public
Parameters
8B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
Llama-Carvalho-GL is a 8B-parameter transformer-based causal language model for Galician, Portuguese, Spanish and English. It is the result of a continual pretraining of meta-llama/Llama-3.1-8B with a multilingual corpus of 340M tokens with emphasis in Galician.
This model is part of the Carvalho familily, a family of LLMs specialized in Portuguese and Galician which can be found here.
The Llama-Carvalho-GL model is ready-to-use only for causal language modeling. It can perform text-generation tasks and be fine-tuned for specific scenarios.
import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
input_text = "Hoxe fai un bo día. O sol "
model_id = "Nos-PT/Llama-Carvalho-GL"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
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 texts in 4 languages, with an emphasis on Galician. The main aim of this is to ensure that the model learns to work with this language perfectly, while maintaining knowledge of languages already known (Spanish, English), learning others (Galician) or adapting existing language varieties (Portuguese-PT instead of Portuguese-BR).
The corpus is composed as follows:
| Corpus | gl | pt | es | en | |
|---|---|---|---|---|---|
| Base plain text corpus | Tokens | 232M | 29M | 29M | 29M |
| Percentage (of the total base corpus) | 74% | 9% | 8,5% | 8,5% | |
| Instructions | 29M Tokens (multilingual) |
The training was conducted on the Galician Supercomputing Center (CESGA), using 4 nodes with 2 GPUs NVIDIA A100 40G.
In process...
For further information, please send an email to
MIT License
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.
@article{rodriguez-etal-2025-enhancing,
title={Enhancing Large Language Models for Underrepresented Varieties: Pretraining Strategies in the Galician-Portuguese Diasystem},
volume={31},
url={https://journals-sol.sbc.org.br/index.php/jbcs/article/view/5766},
DOI={10.5753/jbcs.2025.5766},
number={1},
journal={Journal of the Brazilian Computer Society},
author={Rodríguez, Pablo and Gamallo, Pablo and Santos, Daniel and Sotelo, Susana and Paniagua, Silvia and Pichel, José Ramom and Salgueiro, Pedro and Nogueira, Vítor and Quaresma, Paulo and Garcia, Marcos and Barro, Senén},
year={2025},
month={Oct.},
pages={1049–1062} }