Text Generation
Transformers
Safetensors
English
qwen2
sdft
self-distillation
continual-learning
tool-use
qwen2.5
conversational
text-generation-inference
Instructions to use ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011") model = AutoModelForCausalLM.from_pretrained("ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011
- SGLang
How to use ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011 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 "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011" \ --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": "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011", "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 "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011" \ --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": "ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011 with Docker Model Runner:
docker model run hf.co/ayushnangia-sdft/qwen2.5-7b-instruct-sdft-tooluse-step-1011
File size: 4,071 Bytes
b2a48ca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | ---
library_name: transformers
license: apache-2.0
base_model: Qwen/Qwen2.5-7B-Instruct
tags:
- sdft
- self-distillation
- continual-learning
- tool-use
- qwen2.5
language:
- en
pipeline_tag: text-generation
---
# Qwen2.5-7B-Instruct SDFT — Tool Use (Step 1011)
This model is a **Self-Distillation Fine-Tuned (SDFT)** version of [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct), trained on the ToolAlpaca tool-use dataset.
SDFT is an on-policy learning method from ["Self-Distillation Enables Continual Learning"](https://arxiv.org/abs/2601.19897) that acquires new skills while preserving prior capabilities, significantly reducing catastrophic forgetting compared to standard SFT.
## Training Details
| Parameter | Value |
|-----------|-------|
| Base model | Qwen/Qwen2.5-7B-Instruct |
| Method | SDFT (On-Policy Self-Distillation) |
| Dataset | ToolAlpaca (4,046 training examples) |
| Training step | 1011 / 1011 |
| Learning rate | 2e-5 (cosine schedule, 10% warmup) |
| Batch size | 32 (gradient accumulation) |
| Epochs | 1 |
| Precision | bf16 |
| Max prompt length | 1024 |
| Max completion length | 1024 |
| EMA alpha | 0.01 |
| Hardware | 1x NVIDIA L40S 48GB |
| Training time | ~42 hours (full run) |
## Evaluation Results
### Tool-Use Accuracy (ToolAlpaca test set, 68 examples)
| Metric | Base Model | This Model (Step 1011) |
|--------|-----------|--------------------------|
| Greedy Accuracy | 54.4% | 57.4% |
| pass@1 | 52.6% | 49.9% |
| pass@5 | 61.5% | 64.6% |
| pass@10 | 64.3% | 70.0% |
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1011")
tokenizer = AutoTokenizer.from_pretrained("Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1011")
messages = [{"role": "user", "content": "Your tool-use prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=1024)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
## All Checkpoints
| Step | HuggingFace |
|------|-------------|
| 100 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-100](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-100) |
| 200 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-200](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-200) |
| 300 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-300](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-300) |
| 400 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-400](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-400) |
| 500 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-500](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-500) |
| 600 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-600](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-600) |
| 700 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-700](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-700) |
| 800 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-800](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-800) |
| 900 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-900](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-900) |
| 1000 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1000](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1000) |
| 1011 | [Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1011](https://huggingface.co/Ayushnangia/qwen2.5-7b-instruct-sdft-tooluse-step-1011) |
## Citation
```bibtex
@article{shenfeld2025selfdistillation,
title={Self-Distillation Enables Continual Learning},
author={Shenfeld, Idan and others},
journal={arXiv preprint arXiv:2601.19897},
year={2025}
}
```
|