Text Generation
PEFT
Safetensors
Galician
galician
grammatical-error-correction
gec
grammar-correction
orthographic-correction
text-correction
lora
carvalho
carvalhochat
llama
low-resource-nlp
proxecto-nos
conversational
Instructions to use proxectonos/CarvalhoChat_GEC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use proxectonos/CarvalhoChat_GEC with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("carvalho-nos/CarvalhoChat_v4") model = PeftModel.from_pretrained(base_model, "proxectonos/CarvalhoChat_GEC") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +63 -0
- adapter_config.json +49 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +5 -0
- tokenizer.json +3 -0
- tokenizer_config.json +22 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: carvalho-nos/CarvalhoChat_v4
|
| 3 |
+
library_name: peft
|
| 4 |
+
model_name: rq1_carvalhochat_gl_gec_lora
|
| 5 |
+
tags:
|
| 6 |
+
- base_model:adapter:carvalho-nos/CarvalhoChat_v4
|
| 7 |
+
- lora
|
| 8 |
+
- sft
|
| 9 |
+
- transformers
|
| 10 |
+
- trl
|
| 11 |
+
- unsloth
|
| 12 |
+
licence: license
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Model Card for rq1_carvalhochat_gl_gec_lora
|
| 17 |
+
|
| 18 |
+
This model is a fine-tuned version of [carvalho-nos/CarvalhoChat_v4](https://huggingface.co/carvalho-nos/CarvalhoChat_v4).
|
| 19 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
+
|
| 21 |
+
## Quick start
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
from transformers import pipeline
|
| 25 |
+
|
| 26 |
+
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 27 |
+
generator = pipeline("text-generation", model="None", device="cuda")
|
| 28 |
+
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 29 |
+
print(output["generated_text"])
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
## Training procedure
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
This model was trained with SFT.
|
| 38 |
+
|
| 39 |
+
### Framework versions
|
| 40 |
+
|
| 41 |
+
- PEFT 0.18.1
|
| 42 |
+
- TRL: 0.24.0
|
| 43 |
+
- Transformers: 5.5.0
|
| 44 |
+
- Pytorch: 2.10.0
|
| 45 |
+
- Datasets: 4.3.0
|
| 46 |
+
- Tokenizers: 0.22.2
|
| 47 |
+
|
| 48 |
+
## Citations
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
Cite TRL as:
|
| 53 |
+
|
| 54 |
+
```bibtex
|
| 55 |
+
@misc{vonwerra2022trl,
|
| 56 |
+
title = {{TRL: Transformer Reinforcement Learning}},
|
| 57 |
+
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
|
| 58 |
+
year = 2020,
|
| 59 |
+
journal = {GitHub repository},
|
| 60 |
+
publisher = {GitHub},
|
| 61 |
+
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 62 |
+
}
|
| 63 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "carvalho-nos/CarvalhoChat_v4",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": true,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 32,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.0,
|
| 22 |
+
"megatron_config": null,
|
| 23 |
+
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": null,
|
| 25 |
+
"peft_type": "LORA",
|
| 26 |
+
"peft_version": "0.18.1",
|
| 27 |
+
"qalora_group_size": 16,
|
| 28 |
+
"r": 16,
|
| 29 |
+
"rank_pattern": {},
|
| 30 |
+
"revision": null,
|
| 31 |
+
"target_modules": [
|
| 32 |
+
"up_proj",
|
| 33 |
+
"q_proj",
|
| 34 |
+
"k_proj",
|
| 35 |
+
"o_proj",
|
| 36 |
+
"v_proj",
|
| 37 |
+
"gate_proj",
|
| 38 |
+
"down_proj"
|
| 39 |
+
],
|
| 40 |
+
"target_parameters": null,
|
| 41 |
+
"task_type": "CAUSAL_LM",
|
| 42 |
+
"trainable_token_indices": [
|
| 43 |
+
128256,
|
| 44 |
+
128257
|
| 45 |
+
],
|
| 46 |
+
"use_dora": false,
|
| 47 |
+
"use_qalora": false,
|
| 48 |
+
"use_rslora": false
|
| 49 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25ca9bd2e6fe2e1af5211a2f4b18d938e2e7e1bec08f794ca3594f0ca0c4d69b
|
| 3 |
+
size 2269244472
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>
|
| 2 |
+
|
| 3 |
+
'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>
|
| 4 |
+
|
| 5 |
+
' }}{% endif %}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2ca1468986e7f67ce918d22057748a8ca8d6946e019dfd650de90120dbfeb28
|
| 3 |
+
size 17210396
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|begin_of_text|>",
|
| 4 |
+
"clean_up_tokenization_spaces": true,
|
| 5 |
+
"eos_token": "<|eot_id|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|task:gec|>",
|
| 8 |
+
"<|lang:gl|>"
|
| 9 |
+
],
|
| 10 |
+
"from_slow": true,
|
| 11 |
+
"is_local": false,
|
| 12 |
+
"legacy": false,
|
| 13 |
+
"model_input_names": [
|
| 14 |
+
"input_ids",
|
| 15 |
+
"attention_mask"
|
| 16 |
+
],
|
| 17 |
+
"model_max_length": 131072,
|
| 18 |
+
"pad_token": "<|end_of_text|>",
|
| 19 |
+
"padding_side": "right",
|
| 20 |
+
"tokenizer_class": "TokenizersBackend",
|
| 21 |
+
"use_fast": true
|
| 22 |
+
}
|