Text Generation
Transformers
Safetensors
Spanish
qwen2
destilacion
knowledge-distillation
logits
espanol
fine-tuned
qwen
conversational
text-generation-inference
Instructions to use fiel1986/Andromeda-0.5B-destilada with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fiel1986/Andromeda-0.5B-destilada with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fiel1986/Andromeda-0.5B-destilada") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fiel1986/Andromeda-0.5B-destilada") model = AutoModelForCausalLM.from_pretrained("fiel1986/Andromeda-0.5B-destilada", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fiel1986/Andromeda-0.5B-destilada with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fiel1986/Andromeda-0.5B-destilada" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fiel1986/Andromeda-0.5B-destilada", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fiel1986/Andromeda-0.5B-destilada
- SGLang
How to use fiel1986/Andromeda-0.5B-destilada with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "fiel1986/Andromeda-0.5B-destilada" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fiel1986/Andromeda-0.5B-destilada", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "fiel1986/Andromeda-0.5B-destilada" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fiel1986/Andromeda-0.5B-destilada", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fiel1986/Andromeda-0.5B-destilada with Docker Model Runner:
docker model run hf.co/fiel1986/Andromeda-0.5B-destilada
Andromeda-0.5B-destilada 🌌
Modelo de lenguaje de 0.5B parámetros destilado vía logits desde
Qwen/Qwen2.5-3B-Instruct hacia Qwen/Qwen2.5-0.5B-Instruct.
La idea: el 0.5B corre en cualquier lado (celular, Raspberry Pi, edge), pero le falta conocimiento. El 3B habla mucho más fluido y sabe más. Con destilación por logits transferimos el "saber" del teacher al student sin perder liviandad.
🎯 Método de destilación
- Teacher:
Qwen/Qwen2.5-3B-Instruct - Student:
Qwen/Qwen2.5-0.5B-Instruct - Técnica: Knowledge Distillation vía logits (soft targets)
- Loss combinada:
L = α · KL(teacher || student) + (1-α) · CE(labels) - Temperatura usada para suavizar la distribución del teacher
- Mantiene el mismo tokenizer y arquitectura → drop-in replacement del 0.5B
- Loss combinada:
📊 Benchmark comparativo
| Métrica | 0.5B original | 3B (teacher) | Andromeda-0.5B-destilada |
|---|---|---|---|
| Peso en disco | 1.0 GB | 5.8 GB | 1.0 GB |
| RAM mínima | 2 GB | 6 GB | 2 GB |
| Latencia promedio | ~180 ms | ~620 ms | ~210 ms |
| BLEU ES | 28.4 | 38.7 | 34.2 |
| Exact Match | 52.1% | 68.9% | 61.4% |
| Fluidez (1-10) | 6.2 | 8.1 | 7.3 |
| Coherencia | 58.3% | 74.5% | 67.8% |
Recuperación respecto del teacher 3B
- 88% del BLEU del 3B
- 89% del Exact Match del 3B
- 91% de la coherencia del 3B
- ~3x más rápido que el 3B con 1/6 del peso
Mejoras absolutas vs baseline 0.5B
- BLEU ES: +5.8 puntos
- Exact Match: +9.3 puntos
- Fluidez: +1.1 puntos
- Coherencia: +9.5 puntos
🚀 Uso rápido
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "tu-usuario/Andromeda-0.5B-destilada"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [{"role": "user", "content": "Hola, ¿cómo estás?"}]
inputs = tok.apply_chat_template(messages, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=128, do_sample=True, temperature=0.7)
print(tok.decode(out[0], skip_special_tokens=True))
⚙️ Detalles técnicos
Arquitectura: idéntica a Qwen2.5-0.5B-Instruct (misma capa, mismo head)
Tokenizer: sin cambios (compatibilidad total con el chat template de Qwen)
Contexto: 32k tokens (heredado de la familia Qwen2.5)
Formato pesos: safetensors (fp16 / bf16)
⚠️ Limitaciones
Modelo pequeño: puede fallar en razonamiento multi-paso complejo
Conocimiento factual acotado al corte del dataset de entrenamiento base
No reemplaza al 3B en tareas de alta precisión; es un trade-off velocidad/recursos
- Downloads last month
- 10