Instructions to use silas114514/PMTX1-2B-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use silas114514/PMTX1-2B-adapter with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-2B") model = PeftModel.from_pretrained(base_model, "silas114514/PMTX1-2B-adapter") - Notebooks
- Google Colab
- Kaggle
PMTX1-2B Adapter
PMTX1-2B Adapter is a LoRA adapter trained on top of Qwen/Qwen3.5-2B for Chinese prompt-rewriting coaching (train_aligned style).
Repository Type
This is an adapter repo (PEFT), not a merged full-weight repo.
- Base model required:
Qwen/Qwen3.5-2B - Main weight file:
adapter_model.safetensors - Companion files:
adapter_config.json,tokenizer*,chat_template.jinja
One-Command Pull (Transformers)
pip install -U torch transformers peft bitsandbytes accelerate
python -c "from huggingface_hub import snapshot_download; snapshot_download('silas114514/PMTX1-2B-adapter')"
Quick Inference (Transformers + PEFT)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
base_model = "Qwen/Qwen3.5-2B"
adapter_repo = "silas114514/PMTX1-2B-adapter"
bnb = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
)
tok = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
if tok.pad_token is None:
tok.pad_token = tok.eos_token or tok.unk_token
model = AutoModelForCausalLM.from_pretrained(
base_model,
quantization_config=bnb,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
model = PeftModel.from_pretrained(model, adapter_repo)
model.eval()
prompt = "你是 Prompt Evolution 的提示词纠偏教练。请只做提示词优化,不要直接代做任务。\n原始提示词:写周报,你看着办就行,快一点。"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=200, do_sample=False)
print(tok.decode(out[0], skip_special_tokens=True))
vLLM Notes
Use this adapter with a PEFT-aware serving path. If you need pure one-command deploy for broad testers, prefer the merged repo: silas114514/PMTX1-2B-merged.
Ollama Notes
Official qwen3.5 base models can be pulled in Ollama, but this LoRA adapter is not a direct ollama pull/run artifact. Converting custom Qwen3.5 fine-tunes to Ollama-compatible format may require extra conversion support and verification.
Training Snapshot
- Prompt style:
train_aligned - Max steps:
100 - LoRA layers: top
8 - LoRA targets:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - See
run_summary.json,run_config.json,metrics_summary.json
License and Compliance
- This adapter is a derivative work on top of
Qwen/Qwen3.5-2B. - Follow the base model license and usage terms from the upstream repository.
Known Limitations
- Output format can still drift in some prompts; structured post-processing may still be needed in strict production settings.
- Not designed for factual content generation; optimized for prompt rewriting guidance.
- Downloads last month
- 1