Downloads · 30 days
83
17% of all-time downloads
namanadep/Qwen2.5-7B-Claude-Sonnet-Opus-Distill
Qwen2.5-7B-Claude-Sonnet-Opus-Distill is a text generation model from namanadep. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Fine-tunes Qwen/Qwen2.5-7B-Instruct with QLoRA on a dataset of multi-turn dialogs labeled as Claude 3.5 Sonnet and Claude 3 Opus reasoning traces, then evaluates the result against the untouched base model on 100 held…
Downloads · 30 days
83
17% of all-time downloads
All-time downloads
496
Public
Repo size
15.4 GB
Likes
0
Public
Click a slice to open those files.
.gguf15.2 GB · 99%
From the Hugging Face model README
Fine-tunes Qwen/Qwen2.5-7B-Instruct with QLoRA on a dataset of multi-turn dialogs labeled as Claude 3.5 Sonnet and Claude 3 Opus reasoning traces, then evaluates the result against the untouched base model on 100 held-out technical and academic prompts.
Full code and write-up: github.com/namanadep/qwen2.5-7b-claude-sonnet-opus-distill.
An earlier draft of this project's README included a "Parity Level" table claiming the fine-tuned model reaches ~85-90% of Claude's reasoning style, ~85% of its technical tone, and so on. Those numbers were hardcoded literal text in src/build_100_comparison_md.py, written directly into the report regardless of what the actual 100-prompt evaluation shows. They were not computed from anything. This version removes them and describes only what's directly checkable in 100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md. Full account, including a second corrected claim about a specific example: docs/LIMITATIONS_AND_HONESTY.md on the GitHub repo.
Reading the 100 real base/fine-tuned/gold response triplets in 100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md:
<think> reasoning block before answering on every prompt checked; the base model does not.These are real, spot-checked differences between two actual model outputs, not a claim about overall parity with Claude on any dimension.
Qwen/Qwen2.5-7B-Instruct (7.61B parameters).q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj), via TRL's SFTTrainer.qsardor/Claude-Sonnet-Opus, split 90/10 into 13,500 training and 1,500 validation records. The 100 evaluation prompts are drawn separately from the tail of the same source dataset as a holdout.torchrun --nproc_per_node=2.SFTTrainer logs automatically, but no training_metrics.json or training log is included in this repository to verify the specific final values. Treat them as reported, not independently confirmed here.The training data is a third-party Hugging Face dataset (qsardor/Claude-Sonnet-Opus) that labels its contents as Claude 3.5 Sonnet and Claude 3 Opus outputs. This repository does not independently verify that provenance. If you plan to redistribute or commercialize a model trained this way, note that using another provider's model outputs to train or improve a competing model is restricted under most AI providers' usage policies, including Anthropic's. Review the source dataset's own documentation and the relevant usage policy before doing so.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_id = "Qwen/Qwen2.5-7B-Instruct"
adapter_id = "namanadep/Qwen2.5-7B-Claude-Sonnet-Opus-Distill"
tok = AutoTokenizer.from_pretrained(base_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(model, adapter_id)
adapter_model.safetensors, adapter_config.json, chat_template.jinja, tokenizer.json, tokenizer_config.json: LoRA adapter and tokenizer files.qwen2.5-7b-claude-distill.gguf: F16 GGUF export for Ollama and llama.cpp (15.2 GB).100_PROMPTS_BASE_VS_FINE_TUNED_CLAUDE_DISTILL_COMPARISON.md: the real 100-prompt base/fine-tuned/gold comparison.src/: training, evaluation, and export scripts, mirrored and kept current on GitHub.Apache 2.0 for the code and documentation in this repository. The base Qwen2.5 model and the upstream dataset keep their own terms; see the data provenance note above.