189 lines
5.8 KiB
Markdown
189 lines
5.8 KiB
Markdown
|
|
---
|
|||
|
|
language:
|
|||
|
|
- tr
|
|||
|
|
- en
|
|||
|
|
license: apache-2.0
|
|||
|
|
library_name: transformers
|
|||
|
|
tags:
|
|||
|
|
- causal-lm
|
|||
|
|
- turkish
|
|||
|
|
- phi3
|
|||
|
|
- llm
|
|||
|
|
- text-generation
|
|||
|
|
- pre-training
|
|||
|
|
- syko
|
|||
|
|
pipeline_tag: text-generation
|
|||
|
|
inference: false
|
|||
|
|
datasets:
|
|||
|
|
- uonlp/CulturaX
|
|||
|
|
- HuggingFaceTB/cosmopedia
|
|||
|
|
- roneneldan/TinyStories
|
|||
|
|
- nampdn-ai/tiny-textbooks
|
|||
|
|
- nampdn-ai/tiny-codes
|
|||
|
|
- ise-uiuc/Magicoder-Evol-Instruct-110K
|
|||
|
|
- theblackcat102/evol-codealpaca-v1
|
|||
|
|
- turkish-nlp-suite/InstrucTurca
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# 🧠 SykoLLM V5.6
|
|||
|
|
|
|||
|
|
**SykoLLM V5.6**, SykoLLM ailesinin şu ana kadar eğitilmiş en gelişmiş ve en yetenekli modelidir. Bir önceki nesil olan V5.5-Beta'ya kıyasla çok daha fazla veriyle, çok daha güçlü donanımda eğitilmiştir.
|
|||
|
|
|
|||
|
|
## Modeli Canlı Test Edin
|
|||
|
|
|
|||
|
|
<iframe
|
|||
|
|
src="https://sykoslm-sykollm-v5-6-inference.hf.space"
|
|||
|
|
frameborder="0"
|
|||
|
|
width="850"
|
|||
|
|
height="450"
|
|||
|
|
></iframe>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 📐 Model Mimarisi
|
|||
|
|
|
|||
|
|
| Özellik | Değer |
|
|||
|
|
|---|---|
|
|||
|
|
| **Mimari** | Phi-3 (Causal LM) |
|
|||
|
|
| **Toplam Parametre** | ~447 Milyon |
|
|||
|
|
| **Gizli Katman Boyutu** (`hidden_size`) | 1024 |
|
|||
|
|
| **Ara Katman Boyutu** (`intermediate_size`) | 3072 |
|
|||
|
|
| **Dikkat Başlığı Sayısı** (`num_attention_heads`) | 8 |
|
|||
|
|
| **Katman Sayısı** (`num_hidden_layers`) | 28 |
|
|||
|
|
| **Kelime Hazinesi** (`vocab_size`) | 32.000 |
|
|||
|
|
| **Bağlam Penceresi** | 1024 token |
|
|||
|
|
| **Dikkat Mekanizması** | Flash Attention 2 |
|
|||
|
|
| **Veri Tipi** | bfloat16 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 📚 Eğitim Veri Setleri
|
|||
|
|
|
|||
|
|
| Veri Seti | İçerik Türü | Dil |
|
|||
|
|
|---|---|---|
|
|||
|
|
| [uonlp/CulturaX](https://huggingface.co/datasets/uonlp/CulturaX) | Genel web metinleri (tr bölümü) | 🇹🇷 Türkçe |
|
|||
|
|
| [HuggingFaceTB/cosmopedia](https://huggingface.co/datasets/HuggingFaceTB/cosmopedia) | Sentetik eğitici içerik | 🇬🇧 İngilizce |
|
|||
|
|
| [roneneldan/TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) | Kısa, sade hikayeler | 🇬🇧 İngilizce |
|
|||
|
|
| [nampdn-ai/tiny-textbooks](https://huggingface.co/datasets/nampdn-ai/tiny-textbooks) | Ders kitabı tarzı içerik | 🇬🇧 İngilizce |
|
|||
|
|
| [nampdn-ai/tiny-codes](https://huggingface.co/datasets/nampdn-ai/tiny-codes) | Kod örnekleri ve açıklamalar | 💻 Çokdil |
|
|||
|
|
| [ise-uiuc/Magicoder-Evol-Instruct-110K](https://huggingface.co/datasets/ise-uiuc/Magicoder-Evol-Instruct-110K) | Gelişmiş kodlama talimatları | 💻 Çokdil |
|
|||
|
|
| [theblackcat102/evol-codealpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1) | Kodlama talimatları | 💻 Çokdil |
|
|||
|
|
| [turkish-nlp-suite/InstrucTurca](https://huggingface.co/datasets/turkish-nlp-suite/InstrucTurca) | Türkçe instruction/yanıt çiftleri | 🇹🇷 Türkçe |
|
|||
|
|
|
|||
|
|
> Toplamda yaklaşık **~1.7 Milyon örnek** ile eğitilmiştir.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## ⚙️ Eğitim Detayları
|
|||
|
|
|
|||
|
|
| Parametre | Değer |
|
|||
|
|
|---|---|
|
|||
|
|
| **Kullanılan Donanım** | NVIDIA A100 |
|
|||
|
|
| **Önceki Nesil Donanım** | 2× Tesla T4 (V5.5-Beta) |
|
|||
|
|
| **Batch Boyutu (cihaz başına)** | 16 |
|
|||
|
|
| **Gradyan Birikimi** | 4 (efektif batch: 64) |
|
|||
|
|
| **Öğrenme Hızı** | 5e-5 |
|
|||
|
|
| **LR Zamanlayıcı** | Cosine |
|
|||
|
|
| **Optimizatör** | AdamW (Fused) |
|
|||
|
|
| **Çerçeve** | HuggingFace Transformers + Trainer |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🗣️ Sohbet Formatı ve Özel Token'lar
|
|||
|
|
|
|||
|
|
Bu model aşağıdaki sohbet şablonuyla eğitilmiştir:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
<|user|>
|
|||
|
|
Kullanıcının mesajı<|end|>
|
|||
|
|
<|assistant|>
|
|||
|
|
Modelin yanıtı<|end|>
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Önemli Notlar
|
|||
|
|
|
|||
|
|
- **BOS token yoktur.** Model direkt `<|user|>` ile başlar, başa `<s>` veya herhangi bir başlangıç token'ı **ekleme.**
|
|||
|
|
- **Cümleyi bitiren token `<|end|>`'dir** (ID: 3), `<|endoftext|>` değil. Generate ederken `eos_token_id=3` vermeyi unutma, yoksa model durmaz.
|
|||
|
|
- `<|endoftext|>` (ID: 0) yalnızca vocab'ın 0. slotunu doldurmak için vardır, eğitimde hiç kullanılmamıştır.
|
|||
|
|
|
|||
|
|
### Token ID Tablosu
|
|||
|
|
|
|||
|
|
| Token | ID | Görevi |
|
|||
|
|
|---|---|---|
|
|||
|
|
| `<|endoftext|>` | 0 | Sadece vocab doldurucu, kullanılmıyor |
|
|||
|
|
| `<|user|>` | 1 | Kullanıcı konuşma turunu açar |
|
|||
|
|
| `<|assistant|>` | 2 | Modelin yanıt turunu açar |
|
|||
|
|
| `<|end|>` | 3 | Her konuşma turunu kapatır (gerçek EOS) |
|
|||
|
|
| `<|pad|>` | 4 | Batch padding için |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🚀 Kullanım
|
|||
|
|
|
|||
|
|
```python
|
|||
|
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|||
|
|
import torch
|
|||
|
|
|
|||
|
|
model_id = "SykoSLM/SykoLLM-V5.6"
|
|||
|
|
|
|||
|
|
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|||
|
|
model = AutoModelForCausalLM.from_pretrained(
|
|||
|
|
model_id,
|
|||
|
|
torch_dtype=torch.bfloat16,
|
|||
|
|
device_map="auto"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
def chat(user_message):
|
|||
|
|
# BOS YOK — direkt <|user|> ile başlıyoruz
|
|||
|
|
prompt = f"<|user|>\n{user_message}<|end|>\n<|assistant|>\n"
|
|||
|
|
|
|||
|
|
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|||
|
|
|
|||
|
|
with torch.no_grad():
|
|||
|
|
outputs = model.generate(
|
|||
|
|
**inputs,
|
|||
|
|
max_new_tokens=256,
|
|||
|
|
do_sample=True,
|
|||
|
|
temperature=0.7,
|
|||
|
|
top_p=0.9,
|
|||
|
|
repetition_penalty=1.1,
|
|||
|
|
eos_token_id=3, # <|end|> gelince dur
|
|||
|
|
pad_token_id=4 # <|pad|>
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
# Sadece modelin ürettiği kısmı al, prompt'u çıkar
|
|||
|
|
generated = outputs[0][inputs["input_ids"].shape[1]:]
|
|||
|
|
return tokenizer.decode(generated, skip_special_tokens=True)
|
|||
|
|
|
|||
|
|
|
|||
|
|
print(chat("Merhaba! Kendini tanıtır mısın?"))
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 🗺️ SykoLLM Ailesi
|
|||
|
|
|
|||
|
|
| Versiyon | Durum | Veri Miktarı | Donanım |
|
|||
|
|
|---|---|---|---|
|
|||
|
|
| SykoLLM V5.5-Beta | ✅ Yayında | ~300K örnek | 2× Tesla T4 |
|
|||
|
|
| **SykoLLM V5.6** | ✅ **Yayında** | **~1.7M örnek** | **A100** |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## ⚠️ Sınırlamalar
|
|||
|
|
|
|||
|
|
- Bağlam penceresi **1024 token** ile sınırlıdır.
|
|||
|
|
- Model yalnızca **ön-eğitim (pre-training)** görmüştür; RLHF veya DPO gibi hizalama adımları uygulanmamıştır. Zaman zaman tutarsız yanıtlar üretebilir.
|
|||
|
|
- Kritik, tıbbi, hukuki veya güvenlik gerektiren uygulamalarda kullanımı önerilmez.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 📄 Lisans
|
|||
|
|
|
|||
|
|
Apache 2.0 — Ticari kullanım serbesttir, modelin kaynağının belirtilmesi beklenir.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
*SykoSLM tarafından geliştirilmiştir.*
|