projecte-aina/aguila-7b

Model

Ǎguila-7B

65

63 commits

2 linked in READMEs

updated Feb 27, 2025

See the code

README

Ǎguila-7B

⚠️NOTICE⚠️: This model has been deprecated and is no longer actively maintained or supported. To access the latest models with enhanced features, better performance, and ongoing support, please visit https://huggingface.co/BSC-LT

Table of Contents

Click to expand

Model description

Ǎguila-7B is a transformer-based causal language model for Catalan, Spanish, and English. It is based on the Falcon-7B model and has been trained on a 26B token trilingual corpus collected from publicly available corpora and crawlers.

More information available in the following post from Medium.com: Introducing Ǎguila, a new open-source LLM for Spanish and Catalan (https://medium.com/@mpamies247/introducing-a%CC%8Cguila-a-new-open-source-llm-for-spanish-and-catalan-ee1ebc70bc79)

Intended uses and limitations

The Ǎguila-7B model is ready-to-use only for causal language modeling to perform text-generation tasks. However, it is intended to be fine-tuned for downstream tasks.

How to use

Here is how to use this model:

import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM

input_text = "El mercat del barri és fantàstic, hi pots trobar"

model_id  = "projecte-aina/aguila-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
generator = pipeline(
    "text-generation",
    model=model_id,
    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']}")

Limitations and bias

At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.

Language adaptation

We adapted the original Falcon-7B model to Spanish and Catalan by swapping the tokenizer and adjusting the embedding layer.

The adaptation procedure is explained in this blog post.

Training

Training data

The training corpus consists of 26B tokens of several corpora gathered from web crawlings and public domain data.

DatasetLanguageWords (per-epoch)Epochs
Wikipediaen2169.97M1.428144485
C4_eses53709.80M0.1049686196
Biomedicales455.03M0.7140722425
Legales995.70M0.7140722425
Wikipediaes693.60M1.428144485
Gutenberges53.18M0.7140722425
C4_caca2826.00M2.142216727
Biomedicalca11.80M1.428144485
RacoCatalà Noticiasca17.16M2.142216727
RacoCatalà Forumsca333.73M2.142216727
CaWaCca57.79M2.142216727
Wikipediaca228.01M3.570361212
Vilawebca50.34M2.142216727

The dataset has the following language distribution:

LanguagePercentage
En16.84%
Es41.38%
Ca41.79%

Note: A small amount of English data was kept to avoid catastrophic forgetting.

Training procedure

The training corpus has been tokenized using a byte version of Byte-Pair Encoding (BPE) with a vocabulary size of 50,257 tokens. After training a new tokenizer and adapting falcon-7b's embedding layer, the model was further pre-trained in three target languages: Catalan, Spanish and English.

The training lasted a total of 320 hours on 8 NVIDIA H100 GPUs with 80GB RAM.

Training hyperparameters

  • seed: 42
  • distributed_type: multi-GPU
  • num_devices: 8
  • train_batch_size: 1
  • eval_batch_size: 1
  • total_train_batch_size: 8
  • total_eval_batch_size: 8
  • optimizer: Adam
  • betas: (0.9,0.999)
  • epsilon: 1e-08
  • learning_rate: 5e-05
  • lr_scheduler_type: linear
  • num_epochs: 1.0

Framework versions

  • Pytorch 2.0.0
  • Transformers 4.30.2
  • Datasets 2.13.1
  • Tokenizers 0.13.3

Additional information

Author

The Language Technologies Unit from Barcelona Supercomputing Center.

Contact

For further information, please send an email to langtech@bsc.es.

Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.

License

Apache License, Version 2.0

Funding

This work was funded by:

Disclaimer

Click to expand

The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.

Be aware that the model may have biases and/or any other undesirable distortions.

When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.

In no event shall the owner and creator of the model (Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties.

aguila
catalan
custom_code
endpoints_compatible
falcon
model-index
pytorch
RefinedWebModel
safetensors
spanish
text-generation
text-generation-inference
transformers

Contributors

joanllop

16 commits

gonzalez-agirre

16 commits

Severino

14 commits

mapama247

10 commits

projecte-aina/aguila-7b

Model

Ǎguila-7B

65

63 commits

2 linked in READMEs

updated Feb 27, 2025

See the code

README

Ǎguila-7B

⚠️NOTICE⚠️: This model has been deprecated and is no longer actively maintained or supported. To access the latest models with enhanced features, better performance, and ongoing support, please visit https://huggingface.co/BSC-LT

Table of Contents

Click to expand

Model description

Ǎguila-7B is a transformer-based causal language model for Catalan, Spanish, and English. It is based on the Falcon-7B model and has been trained on a 26B token trilingual corpus collected from publicly available corpora and crawlers.

More information available in the following post from Medium.com: Introducing Ǎguila, a new open-source LLM for Spanish and Catalan (https://medium.com/@mpamies247/introducing-a%CC%8Cguila-a-new-open-source-llm-for-spanish-and-catalan-ee1ebc70bc79)

Intended uses and limitations

The Ǎguila-7B model is ready-to-use only for causal language modeling to perform text-generation tasks. However, it is intended to be fine-tuned for downstream tasks.

How to use

Here is how to use this model:

import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM

input_text = "El mercat del barri és fantàstic, hi pots trobar"

model_id  = "projecte-aina/aguila-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
generator = pipeline(
    "text-generation",
    model=model_id,
    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']}")

Limitations and bias

At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.

Language adaptation

We adapted the original Falcon-7B model to Spanish and Catalan by swapping the tokenizer and adjusting the embedding layer.

The adaptation procedure is explained in this blog post.

Training

Training data

The training corpus consists of 26B tokens of several corpora gathered from web crawlings and public domain data.

DatasetLanguageWords (per-epoch)Epochs
Wikipediaen2169.97M1.428144485
C4_eses53709.80M0.1049686196
Biomedicales455.03M0.7140722425
Legales995.70M0.7140722425
Wikipediaes693.60M1.428144485
Gutenberges53.18M0.7140722425
C4_caca2826.00M2.142216727
Biomedicalca11.80M1.428144485
RacoCatalà Noticiasca17.16M2.142216727
RacoCatalà Forumsca333.73M2.142216727
CaWaCca57.79M2.142216727
Wikipediaca228.01M3.570361212
Vilawebca50.34M2.142216727

The dataset has the following language distribution:

LanguagePercentage
En16.84%
Es41.38%
Ca41.79%

Note: A small amount of English data was kept to avoid catastrophic forgetting.

Training procedure

The training corpus has been tokenized using a byte version of Byte-Pair Encoding (BPE) with a vocabulary size of 50,257 tokens. After training a new tokenizer and adapting falcon-7b's embedding layer, the model was further pre-trained in three target languages: Catalan, Spanish and English.

The training lasted a total of 320 hours on 8 NVIDIA H100 GPUs with 80GB RAM.

Training hyperparameters

  • seed: 42
  • distributed_type: multi-GPU
  • num_devices: 8
  • train_batch_size: 1
  • eval_batch_size: 1
  • total_train_batch_size: 8
  • total_eval_batch_size: 8
  • optimizer: Adam
  • betas: (0.9,0.999)
  • epsilon: 1e-08
  • learning_rate: 5e-05
  • lr_scheduler_type: linear
  • num_epochs: 1.0

Framework versions

  • Pytorch 2.0.0
  • Transformers 4.30.2
  • Datasets 2.13.1
  • Tokenizers 0.13.3

Additional information

Author

The Language Technologies Unit from Barcelona Supercomputing Center.

Contact

For further information, please send an email to langtech@bsc.es.

Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.

License

Apache License, Version 2.0

Funding

This work was funded by:

Disclaimer

Click to expand

The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.

Be aware that the model may have biases and/or any other undesirable distortions.

When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.

In no event shall the owner and creator of the model (Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties.

aguila
catalan
custom_code
endpoints_compatible
falcon
model-index
pytorch
RefinedWebModel
safetensors
spanish
text-generation
text-generation-inference
transformers

Contributors

joanllop

16 commits

gonzalez-agirre

16 commits

Severino

14 commits

mapama247

10 commits