Views
No views yet
Qwen/Qwen3.8-27B (Text-only causal LM backbone)q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj| Metric | Base Model (Qwen3.8-27B NF4) | Turkish-CPT-1M Adapter | Improvement |
|---|---|---|---|
| Turkish Validation Perplexity | 7.5838 | 6.9348 | -8.56% |
| Turkish Test Perplexity | 8.0534 | 7.3303 | -8.98% |
| TurkishMMLU (90-Q Stratified) | 60.00% | 75.56% | +15.56% |
| Belebele Reading Comprehension (TR) | 83.33% | 90.00% | +6.67% |
| Belebele Reading Comprehension (EN) | 96.67% | 96.67% | 100% Retained |
1import torch
2from transformers import AutoTokenizer, BitsAndBytesConfig, Qwen3_5ForCausalLM
3from peft import PeftModel
4
5base_model_id = "Qwen/Qwen3.8-27B"
6adapter_id = "UgurInanc12/Qwen3.8-27B-Turkish-CPT-LoRA-1M"
7
8quantization_config = BitsAndBytesConfig(
9 load_in_4bit=True,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_use_double_quant=True,
12 bnb_4bit_compute_dtype=torch.bfloat16,
13)
14
15tokenizer = AutoTokenizer.from_pretrained(base_model_id)
16base_model = Qwen3_5ForCausalLM.from_pretrained(
17 base_model_id,
18 quantization_config=quantization_config,
19 device_map="auto",
20 torch_dtype=torch.bfloat16,
21)
22
23model = PeftModel.from_pretrained(base_model, adapter_id)
24model.eval()
25
26prompt = "Türkiye'de yapay zeka araştırmalarının geleceği hakkında bir paragraf yaz."
27inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
28
29with torch.inference_mode():
30 outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
31
32print(tokenizer.decode(outputs[0], skip_special_tokens=True))vngrs-ai/vngrs-web-corpus)Qwen/Qwen3.8-27B)