Downloads · 30 days
7
13% of all-time downloads
win10/gpt-oss-20b-heretic-distilled-MiniMax-M2.1-lora
gpt-oss-20b-heretic-distilled-MiniMax-M2.1-lora is a machine learning model from win10. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
Downloads · 30 days
7
13% of all-time downloads
All-time downloads
56
Public
Repo size
3.9 GB
Likes
0
Public
Click a slice to open those files.
.safetensors3.9 GB · 100%
From the Hugging Face model README
中文版本請見:README_ZH.md
This repository provides a PEFT LoRA adapter for kldzj/gpt-oss-20b-heretic-bf16, distilled from MiniMaxAI/MiniMax-M2.1 using weight-delta SVD-LoRA distillation (cross-architecture).
kldzj/gpt-oss-20b-heretic-bf16MiniMaxAI/MiniMax-M2.1q_proj, k_proj, v_proj, o_proj)This adapter approximates the teacher→student weight delta (Δ) with low-rank factors and stores them as LoRA matrices. It is designed for cross-architecture distillation where teacher/student differ in depth and/or hidden dimensions.
This is an adapter. You must load the base model first.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_id = "kldzj/gpt-oss-20b-heretic-bf16"
adapter_id = "win10/gpt-oss-20b-heretic-distilled-MiniMax-M2.1-lora"
tokenizer = AutoTokenizer.from_pretrained(base_id, use_fast=True)
base = AutoModelForCausalLM.from_pretrained(
base_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base, adapter_id)
model.eval()
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain knowledge distillation in 5 bullet points."},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_tensors="pt",
)
with torch.no_grad():
out = model.generate(
inputs.to(model.device),
max_new_tokens=512,
do_sample=False,
)
print(tokenizer.decode(out[0], skip_special_tokens=True))
If you need a single merged checkpoint for inference:
from peft import PeftModel
merged = model.merge_and_unload()
merged.save_pretrained("./merged_model", safe_serialization=True)
tokenizer.save_pretrained("./merged_model")
The adapter was produced with a command equivalent to:
python universal_distill.py \
--teacher ./MiniMax-M2-bf16 \
--student ./gpt-oss-20b-heretic-bf16 \
--output ./MiniMax-M2.1-to-gpt-oss-20b-heretic-bf16-lora-adaptive-delta-ratio-0.35 \
--svd-mode full \
--energy-threshold 0.95 \
--projection-rank 1024 \
--min-rank 1024 \
--max-rank 2880 \
--interp-mode lsq \
--svd-rand-iter 2 \
--svd-rand-oversamples 8 \
--calib-format alpaca \
--calib-alpaca-template classic \
--calib-max-samples 128 \
--calib-max-length 32768 \
--calib-batch-size 2 \
--calib-save ./calib_stats_rombo-code_bagel_hermes-dataset.safetensors \
--calib-data ./data/code_bagel_hermes-2.5.json \
--calib-mode rms \
--mixed-precision \
--max-delta-ratio 0.35
kldzj/gpt-oss-20b-heretic-bf16.gpt-oss-20b variant, it must be shape-compatible (otherwise adapter load will fail).Please follow the license and usage terms of the base model and teacher model as listed on their Hugging Face pages. This repository only provides an adapter; downstream usage must remain compliant with upstream terms.