Instructions to use fenyo/Qwen2.5-7B-base2instruct-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fenyo/Qwen2.5-7B-base2instruct-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fenyo/Qwen2.5-7B-base2instruct-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fenyo/Qwen2.5-7B-base2instruct-SFT") model = AutoModelForCausalLM.from_pretrained("fenyo/Qwen2.5-7B-base2instruct-SFT") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fenyo/Qwen2.5-7B-base2instruct-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fenyo/Qwen2.5-7B-base2instruct-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fenyo/Qwen2.5-7B-base2instruct-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fenyo/Qwen2.5-7B-base2instruct-SFT
- SGLang
How to use fenyo/Qwen2.5-7B-base2instruct-SFT 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 "fenyo/Qwen2.5-7B-base2instruct-SFT" \ --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": "fenyo/Qwen2.5-7B-base2instruct-SFT", "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 "fenyo/Qwen2.5-7B-base2instruct-SFT" \ --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": "fenyo/Qwen2.5-7B-base2instruct-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use fenyo/Qwen2.5-7B-base2instruct-SFT with Docker Model Runner:
docker model run hf.co/fenyo/Qwen2.5-7B-base2instruct-SFT
Qwen2.5-7B-base2instruct — étape SFT
Checkpoint intermédiaire (SFT seul) du pipeline base→instruct SFT → DPO → RLVR appliqué à
Qwen/Qwen2.5-7B. Premier maillon : le modèle de base apprend
ici le format chat (ChatML) et le suivi d'instructions par fine-tuning supervisé.
- 🏁 Modèle final (après DPO + RLVR) :
fenyo/Qwen2.5-7B-base2instruct - 🧪 Étape suivante (DPO) :
fenyo/Qwen2.5-7B-base2instruct-DPO - 📦 Code & recette : https://github.com/AlexandreFenyo/qwen2.5-7b-base2instruct
Entraînement
Full fine-tuning (TRL SFTTrainer), format ChatML, loss sur la réponse assistant uniquement
(assistant_only_loss + balises {% generation %}), liger-kernel, packing, bf16, attention SDPA.
1 epoch, lr 5e-6 cosine, seq_len 4096. Données :
allenai/tulu-3-sft-mixture (180k).
Résultats (lm-eval, backend vLLM)
| étape | IFEval (prompt strict) | GSM8K (flexible) | MMLU |
|---|---|---|---|
| base Qwen2.5-7B | 27.4 | 83.0 | 71.8 |
| + SFT (ce modèle) | 44.9 | 77.5 | 69.1 |
| + DPO | 44.7 | 77.1 | 69.9 |
| + RLVR | 45.1 | 77.4 | 69.9 |
C'est le SFT qui apporte l'essentiel du gain en suivi d'instructions (IFEval 27→45). Détails et analyse : dépôt GitHub.
Usage
Format ChatML, via tokenizer.apply_chat_template. Voir l'exemple sur le
modèle final.
- Downloads last month
- -
Model tree for fenyo/Qwen2.5-7B-base2instruct-SFT
Base model
Qwen/Qwen2.5-7B