Downloads · 30 days
2
1% of all-time downloads
diegogs1451/qwen2.5-7B-Instruct-dUO-finetuned-20260618-100steps
qwen2.5-7B-Instruct-dUO-finetuned-20260618-100steps is a machine learning model from diegogs1451. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This is a LoRA adapter fine-tuned from Qwen2.5-7B-Instruct for generating summarization titles for administrative and legal texts published in Spanish/European official journals: DOUE (EU Official Journal), BOE (Spani…
Downloads · 30 days
2
1% of all-time downloads
All-time downloads
193
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.pt809 MB · 58%
From the Hugging Face model README
This is a LoRA adapter fine-tuned from Qwen2.5-7B-Instruct for generating summarization titles for administrative and legal texts published in Spanish/European official journals: DOUE (EU Official Journal), BOE (Spanish State Gazette), and BOPA (Asturias Regional Gazette).
A lightweight LoRA fine-tune on Qwen2.5-7B-Instruct that produces brief, clear, formal titles ready for publication from official administrative text while preserving essential meaning and eliminating redundancies.
| Parameter | Value |
|---|---|
| Hidden size | 3584 |
| Intermediate size | 18944 |
| Num hidden layers | 28 |
| Num attention heads | 28 |
| Num KV heads | 4 (grouped-query attention) |
| Max position embeddings | 32768 |
| Vocabulary size | 152064 |
| Activation | SiLU |
| Normalization | RMSNorm (eps: 1e-6) |
| RoPE theta | 1000000.0 |
| Sliding window | 131072 |
| Torch dtype | float16 |
| Parameter | Value |
|---|---|
| r (rank) | 8 |
| lora_alpha | 16 |
| lora_dropout | 0.05 |
| bias | None |
| target_modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| task_type | CAUSAL_LM |
All 7 linear projection layers in attention and FFN blocks were targeted. The base model was loaded in 4-bit (NF4, double quantization) via bitsandbytes.
Generate titles from official administrative texts published in DOUE, BOE, and BOPA. The model takes a Spanish administrative/legal text as input and outputs a concise, formal title.
The model was trained with a system prompt instructing it to summarize administrative texts into formal titles while preserving essential meaning and eliminating unnecessary details and redundancies.
Custom dataset of approximately 200 examples (~86k tokens) sourced from:
| Hyperparameter | Value |
|---|---|
| Per device batch size | 2 |
| Gradient accumulation steps | 2 |
| Effective batch size | 4 |
| Per device eval batch size | 8 |
| Learning rate | 2e-5 |
| LR scheduler | Linear (no warmup) |
| Max steps | 100 |
| Epochs | 1 |
| Optimizer | AdamW (betas: 0.9, 0.999; eps: 1e-8) |
| Weight decay | 0.0 |
| Max grad norm | 1.0 |
| Max sequence length | 512 tokens |
| Precision | bfloat16 mixed precision |
| Seed | 42 |
| Gradient checkpointing | False |
| Step | Loss | Token Accuracy | LR |
|---|---|---|---|
| 10 | 1.9584 | 63.9% | 1.82e-5 |
| 20 | 1.6462 | 69.7% | 1.62e-5 |
| 30 | 1.3667 | 74.0% | 1.42e-5 |
| 40 | 1.0743 | 78.3% | 1.22e-5 |
| 50 | 0.8267 | 82.1% | 1.02e-5 |
| 60 | 0.7053 | 85.0% | 8.20e-6 |
| 70 | 0.5500 | 89.1% | 6.20e-6 |
| 80 | 0.5316 | 88.9% | 4.20e-6 |
| 90 | 0.5064 | 89.4% | 2.20e-6 |
| 100 | 0.4638 | 89.9% | 2.0e-7 |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model in 4-bit
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B-Instruct",
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype="float16",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "diegogs1451/qwen2.5-7B-Instruct-dUO")
messages = [
{"role": "system", "content": "Eres un asistente experto en resumir textos oficiales administrativos y jurídicos del DOUE (Diario Oficial de la Unión Europea), del BOE (Boletín Oficial del Estado) y del BOPA (Boletín Oficial del Principado de Asturias) en títulos breves, claros, formales y listos para publicación. Conserva el significado administrativo esencial eliminando detalles innecesarios y redundancias"},
{"role": "user", "content": "<input text>"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Diego Gonzalez Suarez [email protected]