Views
No views yet
qwen2.5-72b-cpt-sft is a two-stage trained version of Qwen 2.5-72B, combining continual pretraining (CPT) and supervised fine-tuning (SFT) using
LoRA adapters in 4-bit NF4 quantization for efficient adaptation. This release contains only the LoRA adapters for the SFT stage and training configuration,
allowing users to load them on top of the CPT adapters (which load on the official Qwen 2.5-72B base model). The CPT stage enhances domain knowledge,
while the SFT stage refines question-answering and conversational skills using synthetic QA data.arxiv.jsonlgov.jsonlnews.jsonlwiki.jsonlaxolotl_deduplicated_synthetic_qa.jsonl| Parameter | Value |
|---|---|
| Sequence length | 2048 |
| Micro batch size | 1 |
| Gradient accumulation | 4 |
| Epochs | 1 |
| Learning rate | 0.0001 |
| LR scheduler | cosine |
| Optimizer | AdamW (8-bit) |
| Warmup steps | 20 |
| Weight decay | 0.0 |
| LoRA rank (r) | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.05 |
| LoRA target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Gradient checkpointing | ✅ |
| Flash attention | ✅ |
| Auto resume | ✅ |
| bnb 4-bit compute dtype | bfloat16 |
| bnb 4-bit quant type | nf4 |
| bnb double quant | true |
| Validation set size | 0.3 |
| Evals per epoch | 10 |
AutoTokenizer<|end_of_text|> as pad_token1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4base_model = "Qwen/Qwen2.5-72B"
5cpt_adapter = "ubitech-edg/qwen2.5-72b-cpt"
6sft_adapter = "ubitech-edg/qwen2.5-72b-cpt-sft"
7
8# Load base and tokenizer
9tokenizer = AutoTokenizer.from_pretrained(base_model)
10model = AutoModelForCausalLM.from_pretrained(
11 base_model, device_map="auto", torch_dtype="bfloat16"
12)
13
14# Load CPT LoRA adapters
15model = PeftModel.from_pretrained(model, cpt_adapter)
16
17# Load SFT LoRA adapters
18model = PeftModel.from_pretrained(model, sft_adapter)
19model.eval()
20
21prompt = "What is the role of AI in renewable energy optimization?"
22inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
23outputs = model.generate(**inputs, max_new_tokens=200)
24print(tokenizer.decode(outputs[0], skip_special_tokens=True))