Text Generation
Transformers
Safetensors
Turkish
English
jamba
mamba
ssm
turkish
conversational
continued-pretraining
sft
Instructions to use serda-dev/Jamba2-3B-Turkish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use serda-dev/Jamba2-3B-Turkish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="serda-dev/Jamba2-3B-Turkish") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("serda-dev/Jamba2-3B-Turkish") model = AutoModelForCausalLM.from_pretrained("serda-dev/Jamba2-3B-Turkish", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use serda-dev/Jamba2-3B-Turkish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "serda-dev/Jamba2-3B-Turkish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "serda-dev/Jamba2-3B-Turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/serda-dev/Jamba2-3B-Turkish
- SGLang
How to use serda-dev/Jamba2-3B-Turkish with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "serda-dev/Jamba2-3B-Turkish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "serda-dev/Jamba2-3B-Turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "serda-dev/Jamba2-3B-Turkish" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "serda-dev/Jamba2-3B-Turkish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use serda-dev/Jamba2-3B-Turkish with Docker Model Runner:
docker model run hf.co/serda-dev/Jamba2-3B-Turkish
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,76 +1,90 @@
|
|
| 1 |
---
|
| 2 |
base_model: serda-dev/Jamba2-3B-Turkish
|
| 3 |
-
library_name:
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
language:
|
| 6 |
- tr
|
| 7 |
license: apache-2.0
|
| 8 |
tags:
|
| 9 |
-
- peft
|
| 10 |
-
- lora
|
| 11 |
-
- qlora
|
| 12 |
- transformers
|
|
|
|
| 13 |
- jamba
|
| 14 |
- turkish
|
| 15 |
- text-generation
|
| 16 |
- conversational
|
| 17 |
- instruction-tuning
|
|
|
|
| 18 |
- cpt
|
| 19 |
- sft
|
| 20 |
-
-
|
|
|
|
| 21 |
---
|
| 22 |
|
| 23 |
-
# Jamba2-3B Turkish CPT + SFT
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
1. **
|
| 28 |
-
2. **Türkçe CPT modeli:**
|
| 29 |
-
3. **Bu model:**
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
## Model Details
|
| 34 |
|
| 35 |
-
|
| 36 |
-
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
##
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
-
- Türkçe instruction-following prototipleri
|
| 52 |
-
- Yerel RAG veya agent sistemlerinde Türkçe yanıt üretimi
|
| 53 |
-
- Türkçe veriyle daha ileri fine-tuning çalışmaları
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
-
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
- `prompt_answer`
|
| 70 |
- `system_prompt_answer`
|
| 71 |
- `messages`
|
| 72 |
|
| 73 |
-
Yerel
|
| 74 |
|
| 75 |
| Metric | Value |
|
| 76 |
| --- | ---: |
|
|
@@ -84,16 +98,14 @@ Yerel eğitim raporuna göre SFT hazırlık istatistikleri:
|
|
| 84 |
| `system_prompt_answer` rows | 5,579 |
|
| 85 |
| JSONL shards | 46 |
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
## Training Procedure
|
| 90 |
|
| 91 |
-
SFT
|
| 92 |
|
| 93 |
| Setting | Value |
|
| 94 |
| --- | --- |
|
| 95 |
| Method | QLoRA |
|
| 96 |
-
| Quantization | 4-bit NF4 |
|
| 97 |
| Double quantization | Enabled |
|
| 98 |
| Compute dtype | bfloat16 |
|
| 99 |
| LoRA rank | 16 |
|
|
@@ -107,59 +119,59 @@ SFT eğitimi QLoRA ile yapılmıştır.
|
|
| 107 |
| Micro batch size | 1 |
|
| 108 |
| Gradient accumulation | 8 |
|
| 109 |
| Max sequence length | 1024 |
|
| 110 |
-
| Max steps |
|
| 111 |
| Total SFT tokens | 40,960,000 |
|
| 112 |
| Training time | about 4.44 hours |
|
| 113 |
|
| 114 |
## Evaluation
|
| 115 |
|
| 116 |
-
Model Turkish MMLU üzerinde yerel olarak
|
| 117 |
|
| 118 |
| Dataset | Split/File | Questions | Accuracy | Answered Accuracy |
|
| 119 |
| --- | --- | ---: | ---: | ---: |
|
| 120 |
| `alibayram/turkish_mmlu` | `train-00000-of-00001.parquet` | 2,000 | 36.5% | 36.70% |
|
| 121 |
|
| 122 |
-
|
| 123 |
|
| 124 |
-
##
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
```python
|
| 135 |
import torch
|
| 136 |
-
from
|
| 137 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 138 |
|
| 139 |
-
|
| 140 |
-
adapter_id = "serda-dev/Jamba2-3B-Turkish-SFT" # replace with this repo id if different
|
| 141 |
|
| 142 |
-
|
| 143 |
-
load_in_4bit=True,
|
| 144 |
-
bnb_4bit_quant_type="nf4",
|
| 145 |
-
bnb_4bit_use_double_quant=True,
|
| 146 |
-
bnb_4bit_compute_dtype=torch.bfloat16,
|
| 147 |
-
)
|
| 148 |
-
|
| 149 |
-
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
|
| 150 |
model = AutoModelForCausalLM.from_pretrained(
|
| 151 |
-
|
| 152 |
device_map="auto",
|
| 153 |
torch_dtype=torch.bfloat16,
|
| 154 |
-
quantization_config=bnb_config,
|
| 155 |
attn_implementation="sdpa",
|
|
|
|
| 156 |
)
|
| 157 |
-
model = PeftModel.from_pretrained(model, adapter_id)
|
| 158 |
model.eval()
|
| 159 |
|
| 160 |
messages = [
|
| 161 |
{"role": "system", "content": "Sen Türkçe yanıt veren yardımcı bir asistansın."},
|
| 162 |
-
{"role": "user", "content": "
|
| 163 |
]
|
| 164 |
|
| 165 |
input_ids = tokenizer.apply_chat_template(
|
|
@@ -181,9 +193,43 @@ with torch.no_grad():
|
|
| 181 |
print(tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True))
|
| 182 |
```
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
## Prompt Format
|
| 185 |
|
| 186 |
-
Model
|
|
|
|
|
|
|
| 187 |
|
| 188 |
```text
|
| 189 |
<|im_start|>system
|
|
@@ -193,8 +239,6 @@ Soru veya talimat<|im_end|>
|
|
| 193 |
<|im_start|>assistant
|
| 194 |
```
|
| 195 |
|
| 196 |
-
`tokenizer.apply_chat_template(...)` kullanılması önerilir.
|
| 197 |
-
|
| 198 |
## Limitations and Risks
|
| 199 |
|
| 200 |
- Model Türkçe kullanım için optimize edilmiştir; diğer dillerde performans değişebilir.
|
|
@@ -204,6 +248,25 @@ Soru veya talimat<|im_end|>
|
|
| 204 |
- Safety alignment kapsamı sınırlıdır; üretimler uygulama katmanında filtrelenmelidir.
|
| 205 |
- Eğitim verisi lisansları ve dağıtım koşulları, modeli public olarak paylaşmadan önce ayrıca doğrulanmalıdır.
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
## Citation
|
| 208 |
|
| 209 |
Upstream model:
|
|
@@ -212,14 +275,12 @@ Upstream model:
|
|
| 212 |
@misc{ai21jamba2,
|
| 213 |
title = {AI21 Jamba2-3B},
|
| 214 |
author = {AI21 Labs},
|
| 215 |
-
year = {2026},
|
| 216 |
url = {https://huggingface.co/ai21labs/AI21-Jamba2-3B}
|
| 217 |
}
|
| 218 |
```
|
| 219 |
|
| 220 |
## Framework Versions
|
| 221 |
|
| 222 |
-
-
|
| 223 |
-
-
|
| 224 |
-
-
|
| 225 |
-
- PyTorch
|
|
|
|
| 1 |
---
|
| 2 |
base_model: serda-dev/Jamba2-3B-Turkish
|
| 3 |
+
library_name: transformers
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
language:
|
| 6 |
- tr
|
| 7 |
license: apache-2.0
|
| 8 |
tags:
|
|
|
|
|
|
|
|
|
|
| 9 |
- transformers
|
| 10 |
+
- safetensors
|
| 11 |
- jamba
|
| 12 |
- turkish
|
| 13 |
- text-generation
|
| 14 |
- conversational
|
| 15 |
- instruction-tuning
|
| 16 |
+
- continued-pretraining
|
| 17 |
- cpt
|
| 18 |
- sft
|
| 19 |
+
- qlora
|
| 20 |
+
- base_model:finetune:serda-dev/Jamba2-3B-Turkish
|
| 21 |
---
|
| 22 |
|
| 23 |
+
# Jamba2-3B Turkish CPT + SFT
|
| 24 |
+
|
| 25 |
+
Bu model, [`ai21labs/AI21-Jamba2-3B`](https://huggingface.co/ai21labs/AI21-Jamba2-3B) temel modeli üzerine Türkçe odaklı continued pre-training (CPT) ve ardından instruction supervised fine-tuning (SFT) uygulanarak hazırlanmıştır.
|
| 26 |
|
| 27 |
+
Eğitim hattı üç aşamadan oluşur:
|
| 28 |
|
| 29 |
+
1. **Temel model:** `ai21labs/AI21-Jamba2-3B`
|
| 30 |
+
2. **Türkçe CPT modeli:** `serda-dev/Jamba2-3B-Turkish`
|
| 31 |
+
3. **Bu model:** CPT modeli üzerine Türkçe instruction verileriyle QLoRA SFT uygulanmış sürüm
|
| 32 |
|
| 33 |
+
Model Türkçe sohbet, komut takip etme, soru-cevap, açıklama, özetleme ve genel metin üretimi için tasarlanmıştır.
|
| 34 |
|
| 35 |
## Model Details
|
| 36 |
|
| 37 |
+
| Field | Value |
|
| 38 |
+
| --- | --- |
|
| 39 |
+
| Model type | Jamba causal language model |
|
| 40 |
+
| Original base model | `ai21labs/AI21-Jamba2-3B` |
|
| 41 |
+
| CPT checkpoint | `serda-dev/Jamba2-3B-Turkish` |
|
| 42 |
+
| Language | Turkish (`tr`) |
|
| 43 |
+
| Task | Text generation, chat, instruction following |
|
| 44 |
+
| Architecture | `JambaForCausalLM` |
|
| 45 |
+
| Hidden size | 2560 |
|
| 46 |
+
| Layers | 28 |
|
| 47 |
+
| Attention heads | 20 |
|
| 48 |
+
| Vocabulary size | 69,632 |
|
| 49 |
+
| Saved dtype | bfloat16 |
|
| 50 |
+
| SFT context length | 1024 tokens |
|
| 51 |
|
| 52 |
+
## Training Overview
|
| 53 |
|
| 54 |
+
### 1. Continued Pre-Training
|
| 55 |
|
| 56 |
+
İlk aşamada `ai21labs/AI21-Jamba2-3B`, Türkçe dil dağılımına uyum sağlaması için continued pre-training ile eğitildi. CPT aşamasında yaklaşık **200 GB düzeyinde** Türkçe ağırlıklı metin verisi kullanıldı.
|
| 57 |
|
| 58 |
+
CPT süreci yalnızca Türkçe metinle sınırlı tutulmadı. Türkçe adaptasyon sırasında modelin genel muhakeme, matematik, yapısal metin ve kod benzeri bağımlılıkları kaybetmemesi için Türkçe veriyle birlikte seçilmiş İngilizce kaynaklar da karıştırıldı.
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
Repo konfigürasyonundaki dört fazlı CPT müfredatı:
|
| 61 |
+
|
| 62 |
+
| Phase | Purpose | Turkish target | English / auxiliary target |
|
| 63 |
+
| --- | --- | ---: | ---: |
|
| 64 |
+
| 1 | Turkish bridge | 30 GB | 10 GB DCLM + 5 GB English Wikipedia |
|
| 65 |
+
| 2 | High-quality transfer | 30 GB | 10 GB FineWeb-Edu (`score >= 4.0`) |
|
| 66 |
+
| 3 | Reasoning preservation | 30 GB | 10 GB OpenWebMath |
|
| 67 |
+
| 4 | Annealing / code preservation | 30 GB | 10 GB StarCoder Python |
|
| 68 |
|
| 69 |
+
Türkçe ana kaynak:
|
| 70 |
|
| 71 |
+
```text
|
| 72 |
+
MRBeDev/MC4veOSCARTekrarsizBirlestirilmis
|
| 73 |
+
```
|
| 74 |
|
| 75 |
+
CPT tarafında uzun JSONL/GZ shard'ları stream edilerek okunmuş, tokenlar tekrar kullanılabilir token cache shard'larına paketlenmiş ve eğitim checkpoint/resume destekli şekilde yürütülmüştür.
|
| 76 |
|
| 77 |
+
### 2. Supervised Fine-Tuning
|
| 78 |
|
| 79 |
+
CPT modeli üzerine Türkçe instruction verileriyle SFT uygulanmıştır. SFT eğitimi QLoRA ile yapılmış, ardından adapter tam modelle birleştirilebilir şekilde kaydedilmiştir.
|
| 80 |
|
| 81 |
+
SFT verisi farklı şemalardan tek bir eğitim formatına normalize edilmiştir:
|
| 82 |
|
| 83 |
- `prompt_answer`
|
| 84 |
- `system_prompt_answer`
|
| 85 |
- `messages`
|
| 86 |
|
| 87 |
+
Yerel veri hazırlama raporundaki SFT istatistikleri:
|
| 88 |
|
| 89 |
| Metric | Value |
|
| 90 |
| --- | ---: |
|
|
|
|
| 98 |
| `system_prompt_answer` rows | 5,579 |
|
| 99 |
| JSONL shards | 46 |
|
| 100 |
|
| 101 |
+
Kullanılan kaynak şemalar arasında `system/user/assistant`, `messages + answer`, `talimat/giriş/çıktı`, `soru/cevap` ve `input/output` biçimleri bulunur.
|
|
|
|
|
|
|
| 102 |
|
| 103 |
+
## SFT Hyperparameters
|
| 104 |
|
| 105 |
| Setting | Value |
|
| 106 |
| --- | --- |
|
| 107 |
| Method | QLoRA |
|
| 108 |
+
| Quantization during training | 4-bit NF4 |
|
| 109 |
| Double quantization | Enabled |
|
| 110 |
| Compute dtype | bfloat16 |
|
| 111 |
| LoRA rank | 16 |
|
|
|
|
| 119 |
| Micro batch size | 1 |
|
| 120 |
| Gradient accumulation | 8 |
|
| 121 |
| Max sequence length | 1024 |
|
| 122 |
+
| Max steps | 5,000 |
|
| 123 |
| Total SFT tokens | 40,960,000 |
|
| 124 |
| Training time | about 4.44 hours |
|
| 125 |
|
| 126 |
## Evaluation
|
| 127 |
|
| 128 |
+
Model Turkish MMLU üzerinde yerel olarak kontrol edilmiştir. Bu sonuç kapsamlı bir benchmark iddiası değil, aynı eval scriptiyle alınmış pratik bir doğrulama sonucudur.
|
| 129 |
|
| 130 |
| Dataset | Split/File | Questions | Accuracy | Answered Accuracy |
|
| 131 |
| --- | --- | ---: | ---: | ---: |
|
| 132 |
| `alibayram/turkish_mmlu` | `train-00000-of-00001.parquet` | 2,000 | 36.5% | 36.70% |
|
| 133 |
|
| 134 |
+
Not: Çoktan seçmeli benchmarklarda prompt/parse formatı sonuca hassastır. Modeli farklı bir chat template, adapter merge veya generation ayarıyla değerlendirirken aynı evaluation formatının korunması önerilir.
|
| 135 |
|
| 136 |
+
## Intended Use
|
| 137 |
|
| 138 |
+
Bu model aşağıdaki kullanımlar için uygundur:
|
| 139 |
|
| 140 |
+
- Türkçe sohbet ve asistan uygulamaları
|
| 141 |
+
- Türkçe instruction-following prototipleri
|
| 142 |
+
- Türkçe soru-cevap ve açıklama üretimi
|
| 143 |
+
- Yerel RAG veya agent sistemlerinde Türkçe yanıt üretimi
|
| 144 |
+
- Türkçe veriyle daha ileri fine-tuning çalışmaları
|
| 145 |
+
|
| 146 |
+
## Out-of-Scope Use
|
| 147 |
|
| 148 |
+
Model tıbbi, hukuki, finansal veya güvenlik açısından kritik kararlar için tek başına otorite olarak kullanılmamalıdır. Zararlı içerik üretimi, kişisel veri çıkarma, kimlik avı, kötüye kullanım otomasyonu veya yasa dışı amaçlar kapsam dışıdır.
|
| 149 |
+
|
| 150 |
+
## Usage
|
| 151 |
+
|
| 152 |
+
### Full merged model
|
| 153 |
+
|
| 154 |
+
Bu repo tam model ağırlıklarını içeriyorsa doğrudan `AutoModelForCausalLM` ile yüklenebilir:
|
| 155 |
|
| 156 |
```python
|
| 157 |
import torch
|
| 158 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 159 |
|
| 160 |
+
model_id = "serda-dev/Jamba2-3B-Turkish-SFT" # replace with this repo id
|
|
|
|
| 161 |
|
| 162 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
model = AutoModelForCausalLM.from_pretrained(
|
| 164 |
+
model_id,
|
| 165 |
device_map="auto",
|
| 166 |
torch_dtype=torch.bfloat16,
|
|
|
|
| 167 |
attn_implementation="sdpa",
|
| 168 |
+
trust_remote_code=True,
|
| 169 |
)
|
|
|
|
| 170 |
model.eval()
|
| 171 |
|
| 172 |
messages = [
|
| 173 |
{"role": "system", "content": "Sen Türkçe yanıt veren yardımcı bir asistansın."},
|
| 174 |
+
{"role": "user", "content": "Bu model ne için kullanılır?"},
|
| 175 |
]
|
| 176 |
|
| 177 |
input_ids = tokenizer.apply_chat_template(
|
|
|
|
| 193 |
print(tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True))
|
| 194 |
```
|
| 195 |
|
| 196 |
+
### PEFT adapter version
|
| 197 |
+
|
| 198 |
+
Bu repo yalnızca LoRA/QLoRA adapter ağırlıklarını içeriyorsa base model ile birlikte yükleyin:
|
| 199 |
+
|
| 200 |
+
```python
|
| 201 |
+
import torch
|
| 202 |
+
from peft import PeftModel
|
| 203 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
| 204 |
+
|
| 205 |
+
base_model_id = "serda-dev/Jamba2-3B-Turkish"
|
| 206 |
+
adapter_id = "serda-dev/Jamba2-3B-Turkish-SFT" # replace with this repo id
|
| 207 |
+
|
| 208 |
+
bnb_config = BitsAndBytesConfig(
|
| 209 |
+
load_in_4bit=True,
|
| 210 |
+
bnb_4bit_quant_type="nf4",
|
| 211 |
+
bnb_4bit_use_double_quant=True,
|
| 212 |
+
bnb_4bit_compute_dtype=torch.bfloat16,
|
| 213 |
+
)
|
| 214 |
+
|
| 215 |
+
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
|
| 216 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 217 |
+
base_model_id,
|
| 218 |
+
device_map="auto",
|
| 219 |
+
torch_dtype=torch.bfloat16,
|
| 220 |
+
quantization_config=bnb_config,
|
| 221 |
+
attn_implementation="sdpa",
|
| 222 |
+
trust_remote_code=True,
|
| 223 |
+
)
|
| 224 |
+
model = PeftModel.from_pretrained(model, adapter_id)
|
| 225 |
+
model.eval()
|
| 226 |
+
```
|
| 227 |
+
|
| 228 |
## Prompt Format
|
| 229 |
|
| 230 |
+
Model chat template ile eğitilmiştir. `tokenizer.apply_chat_template(...)` kullanılması önerilir.
|
| 231 |
+
|
| 232 |
+
Örnek format:
|
| 233 |
|
| 234 |
```text
|
| 235 |
<|im_start|>system
|
|
|
|
| 239 |
<|im_start|>assistant
|
| 240 |
```
|
| 241 |
|
|
|
|
|
|
|
| 242 |
## Limitations and Risks
|
| 243 |
|
| 244 |
- Model Türkçe kullanım için optimize edilmiştir; diğer dillerde performans değişebilir.
|
|
|
|
| 248 |
- Safety alignment kapsamı sınırlıdır; üretimler uygulama katmanında filtrelenmelidir.
|
| 249 |
- Eğitim verisi lisansları ve dağıtım koşulları, modeli public olarak paylaşmadan önce ayrıca doğrulanmalıdır.
|
| 250 |
|
| 251 |
+
## Reproducibility Notes
|
| 252 |
+
|
| 253 |
+
CPT ve SFT süreçlerinde kullanılan yerel repo klasörleri:
|
| 254 |
+
|
| 255 |
+
- `mamba-cpt-tr`: Jamba2-3B üzerine Türkçe CPT pipeline'ı
|
| 256 |
+
- `jamba-sft`: CPT model üzerine QLoRA SFT pipeline'ı
|
| 257 |
+
|
| 258 |
+
SFT tarafındaki ana config:
|
| 259 |
+
|
| 260 |
+
```text
|
| 261 |
+
configs/sft_train.yaml
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
CPT tarafındaki ana config:
|
| 265 |
+
|
| 266 |
+
```text
|
| 267 |
+
configs/cpt_4phase.yaml
|
| 268 |
+
```
|
| 269 |
+
|
| 270 |
## Citation
|
| 271 |
|
| 272 |
Upstream model:
|
|
|
|
| 275 |
@misc{ai21jamba2,
|
| 276 |
title = {AI21 Jamba2-3B},
|
| 277 |
author = {AI21 Labs},
|
|
|
|
| 278 |
url = {https://huggingface.co/ai21labs/AI21-Jamba2-3B}
|
| 279 |
}
|
| 280 |
```
|
| 281 |
|
| 282 |
## Framework Versions
|
| 283 |
|
| 284 |
+
- Transformers: 4.57.6
|
| 285 |
+
- PEFT: 0.18.1
|
| 286 |
+
- Training dtype: bfloat16
|
|
|