umsa-v1/dataset_parafraseado_grupo1
Viewer • Updated • 470 • 49
How to use umsa-v1/maestro_Qwen2.5_0.5B_grupo1 with PEFT:
Task type is invalid.
| Integrante |
|---|
| Chipana Wariste, Ronald Humberto |
| Mamani Huanca, Noemi Marisol |
| Mamani Mena, Luz Alizon |
| Oyardo Acuña, Roni Edwin |
| Ordoñez Marca, Marco Vladimir |
| Quino Jiménez, Víctor Daniel |
| Soto Palli, Ever Alcides |
Maestría en IA y Data Science para la Transformación de Negocios
Este repositorio contiene el Teacher Model del pipeline de Knowledge Distillation desarrollado por el Grupo 1. El modelo Qwen2.5-0.5B-Instruct fue fine-tuned con LoRA sobre un dataset personalizado de parafraseo para entrenar posteriormente un modelo Student (SmolLM2-135M).
Este Modelo (Teacher)
Qwen2.5-0.5B
↓
Conocimiento
↓
Student Model
SmolLM2-135M
umsa-v1/dataset_parafraseado_grupo1apply_chat_template()SFTTrainer + SFTConfig)| Parámetro | Valor |
|---|---|
| r | 16 |
| lora_alpha | 32 |
| lora_dropout | 0.05 |
| bias | none |
| task_type | CAUSAL_LM |
Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
| Parámetro | Valor |
|---|---|
| Epochs | 3 |
| Batch Size | 4 |
| Gradient Accumulation | 4 |
| Effective Batch Size | 16 |
| Learning Rate | 2e-4 |
| Scheduler | Cosine |
| Max Sequence Length | 256 |
| Weight Decay | 0.01 |
| Warmup Ratio | 0.03 |
pip install torch transformers datasets peft trl accelerate bitsandbytes
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Cargar modelo y adaptadores
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
model = PeftModel.from_pretrained(base_model, "path/to/this/model")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
# Generar respuesta
messages = [{"role": "user", "content": "¿Qué es el RGPD?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0]))
# Para inferencia más rápida
model = model.merge_and_unload()
@misc{qwen25_teacher_grupo1_2024,
title={Qwen2.5-0.5B Fine-Tuned: Teacher Model for Legal Knowledge Distillation},
author={Grupo 1 - Modelamiento de Datos II},
year={2024},
publisher={HuggingFace}
}
Grupo 1 | Modelamiento de Datos II
🧠 Teacher Model • Knowledge Distillation • RGPD