Views
No views yet
⚠️ โมเดลนี้เป็น Mixture-of-Experts (26B total, 4B active) — ใช้ VRAM น้อยกว่า Dense 31B ⚠️ GGUF version ถอดเฉพาะ attention+MLP (ไม่มี expert tensors) — 18 MB
| ไฟล์ | คำอธิบาย |
|---|---|
| PEFT LoRA weights (ใช้กับ transformers/peft) | |
| LoRA config (rank=8, alpha=8) | |
| GGUF format (attention+MLP only, ไม่รวม experts) |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5# 1. โหลด base model (MoE — 4B active, ประหยัด VRAM)
6base_model = AutoModelForCausalLM.from_pretrained(
7 "google/gemma-4-26B-A4B-it",
8 torch_dtype=torch.bfloat16,
9 device_map="auto",
10)
11tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-26B-A4B-it")
12
13# 2. โหลด LoRA adapter
14model = PeftModel.from_pretrained(base_model, "hotdogs/gemma4-26b-opus-lora")
15
16# 3. ใช้งาน
17messages = [{"role": "user", "content": "Solve this step by step: 3x + 7 = 22"}]
18inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
19outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))1# GGUF เป็น attention+MLP only (18 MB)
2./llama-server \
3 -m gemma-4-26B-A4B-it-Q4_K_M.gguf \
4 --lora gguf/adapter_model.gguf \
5 --lora-scaled gguf/adapter_model.gguf:1.0 \
6 --host 0.0.0.0 --port 8080 \
7 --ctx-size 8192 -fa --jinjaFROM gemma4:26b
ADAPTER ./gguf/adapter_model.gguf
PARAMETER temperature 0.7
SYSTEM "You are a thoughtful AI that reasons step by step."| Parameter | Value |
|---|---|
| Base Model | |
| Source | |
| Training | Unsloth SFT |
| Rank | 8 |
| Alpha | 8 |
| Target Modules | Attention + MLP + Experts (full LoRA) |
| PEFT Size | 944 MB |
| GGUF Size | 18 MB (attn+MLP only) |
⚠️ GGUF note: expert tensors (120 tensors, MoE-specific) ถอดออกเพราะ llama.cpp ยังไม่รองรับ — เหลือเฉพาะ attention + MLP (410 tensors)