ceofast commited on
Commit
210543d
·
1 Parent(s): 9191841

Update adapter rank 768

Browse files
Files changed (3) hide show
  1. README.md +26 -23
  2. adapter_config.json +5 -5
  3. adapter_model.safetensors +2 -2
README.md CHANGED
@@ -17,21 +17,22 @@ pipeline_tag: text-generation
17
 
18
  # Kumru-2B LoRA Adapter
19
 
20
- This repository provides a **LoRA** adapter distilled from the **VNGRS Kumru-2B** model (`vngrs-ai/Kumru-2B`,
21
- the SFT/chat variant) to be applied on top of the base model `vngrs-ai/Kumru-2B-Base`.
22
- The goal is to transfer Kumru's chat/instruction behavior to `Kumru-2B-Base` deployments with a lightweight file footprint.
 
23
 
24
- ## Model Summary
25
 
26
- - **Base model:** `vngrs-ai/Kumru-2B-Base`
27
- - **Source (target behavior) model:** `vngrs-ai/Kumru-2B` (SFT/chat)
28
- - **Technique:** Low-Rank Adaptation (LoRA)
29
- - **LoRA rank / alpha:** 512 / 1024 (update these if you produce a different buidl)
30
- - **Layer coverage:** All self-attention and MLP projections
31
- - **Output artifacts:** PEFT-compatible `adapter_config.json` + `adapter_model.safetensor`
32
- - **Licence:** Apache 2.0 (aligned with VNGRS Kumru model licensing)
33
 
34
- ## Usage
35
 
36
  ```python
37
  from peft import PeftModel
@@ -52,20 +53,22 @@ pipeline_tag: text-generation
52
  outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
53
  print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
54
  ```
55
- > Not: This adapter must be used together with `vngrs-ai/Kumru-2B-Base`.
56
 
57
- ## Extraction Process
58
 
59
- The adapter is obtained by computing the **delta** between the base and the SFT checkpoints and factorizing it with
60
- **SVD** into low-rank components.
61
- In this release, the measured reconstruction error is approximately **0.49**. To better preserve quality, you may
62
- increase rank/alpha and export a new version (e.g., rank 768 / alpha 1024). A lower-error build will be added as soon
63
- as possible.
64
 
65
  - Script: export_kumru.py
66
 
67
- ## Known Limitations
68
 
69
- - Kumru-2B is still a ~2B-parameter model; it may struggle with very long context, rare technical terms, and complex math.
70
- - With low ranks, SVD-based LoRA can be less stable than the original SFT checkpoint.
71
- - Training data is based on VNGRS’s public Turkish corpus cleaning pipeline; truthfulness/hallucination issues may still occur.
 
 
 
 
 
17
 
18
  # Kumru-2B LoRA Adapter
19
 
20
+ Bu repo, **VNGRS Kumru-2B** modelinin (`vngrs-ai/Kumru-2B`) SFT sürümünü temel alarak,
21
+ `vngrs-ai/Kumru-2B-Base` modeli üzerine uygulanmak üzere çıkarılmış bir **LoRA** adaptörüdür.
22
+ Adapter, Kumru’nun chat/instruction davranışını `vngrs-ai/Kumru-2B-Base` tabanlı dağıtımlara
23
+ hafif dosya boyutuyla taşımak için oluşturulmuştur.
24
 
25
+ ## Model Özeti
26
 
27
+ - **Taban model:** `vngrs-ai/Kumru-2B-Base`
28
+ - **Kaynak (hedef) model:** `vngrs-ai/Kumru-2B` (SFT/chat)
29
+ - **Teknik:** Low-Rank Adaptation (LoRA)
30
+ - **LoRA rank / alpha:** 64 / 64 _(farklı sürüm oluşturduysanız güncelleyin)_
31
+ - **Katman kapsamı:** Tüm self-attention ve MLP projeksiyonları
32
+ - **Çıktı:** PEFT uyumlu `adapter_config.json` + `adapter_model.safetensors`
33
+ - **Lisans:** Apache 2.0 (VNGRS’in Kumru modelleriyle uyumlu)
34
 
35
+ ## Kullanım
36
 
37
  ```python
38
  from peft import PeftModel
 
53
  outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
54
  print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
55
  ```
56
+ > Not: Adapter yalnızca vngrs-ai/Kumru-2B-Base ile birlikte kullanılmalıdır.
57
 
58
+ ## Çıkarma Süreci
59
 
60
+ Adapter, base ve SFT checkpoint’leri arasındaki delta’nın SVD ile düşük-rank faktörlere ayrılmasıyla elde edilmiştir.
61
+ Bu sürümde hesaplanan rekonstrüksiyon hatası yaklaşık 0.78’dir; kaliteyi korumak için rank/alpha değerlerini artırıp
62
+ yeni bir sürüm çıkarabilirsiniz (ör. rank 256 / alpha 512). En kısa sürede daha düşük hatalı sürüm eklenecektir.
 
 
63
 
64
  - Script: export_kumru.py
65
 
66
+ ## Bilinen Sınırlamalar
67
 
68
+ - Kumru-2B hâlâ 2B parametreli bir modeldir; uzun bağlam, nadir teknik terimler ve matematikte hatalar görülebilir.
69
+ - Rank düşük olduğunda SVD tabanlı LoRA, orijinal SFT checkpoint’i kadar stabil olmayabilir.
70
+ - Eğitim verisi VNGRS’in kamuya açık Türkçe corpus temizleme akışına dayanmaktadır; doğruluk/hallucination problemleri
71
+ hâlen görülebilir.
72
+ ### Framework versions
73
+
74
+ - PEFT 0.11.1
adapter_config.json CHANGED
@@ -16,17 +16,17 @@
16
  "megatron_core": "megatron.core",
17
  "modules_to_save": null,
18
  "peft_type": "LORA",
19
- "r": 512,
20
  "rank_pattern": {},
21
  "revision": null,
22
  "target_modules": [
23
- "up_proj",
24
  "q_proj",
25
- "k_proj",
26
- "down_proj",
27
  "o_proj",
28
  "v_proj",
29
- "gate_proj"
 
 
 
30
  ],
31
  "task_type": "CAUSAL_LM",
32
  "use_dora": false,
 
16
  "megatron_core": "megatron.core",
17
  "modules_to_save": null,
18
  "peft_type": "LORA",
19
+ "r": 768,
20
  "rank_pattern": {},
21
  "revision": null,
22
  "target_modules": [
 
23
  "q_proj",
 
 
24
  "o_proj",
25
  "v_proj",
26
+ "up_proj",
27
+ "k_proj",
28
+ "gate_proj",
29
+ "down_proj"
30
  ],
31
  "task_type": "CAUSAL_LM",
32
  "use_dora": false,
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2def29151c0ac887223e61f1f9aff3ecd3463f9813a35c34549d36bf92a63bb4
3
- size 1085310712
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15514500c008df738982869a0185f8f5b90757d85527a7000ab579fbe25e9cef
3
+ size 1627948952