Text Generation
PEFT
Safetensors
Transformers
Turkish
lora
sft
trl
turkish
rap
ceza
chatbot
conversational
Instructions to use SalihHub/Kumru-2B-Ceza-Lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use SalihHub/Kumru-2B-Ceza-Lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("vngrs-ai/Kumru-2B") model = PeftModel.from_pretrained(base_model, "SalihHub/Kumru-2B-Ceza-Lora") - Transformers
How to use SalihHub/Kumru-2B-Ceza-Lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SalihHub/Kumru-2B-Ceza-Lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SalihHub/Kumru-2B-Ceza-Lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SalihHub/Kumru-2B-Ceza-Lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SalihHub/Kumru-2B-Ceza-Lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SalihHub/Kumru-2B-Ceza-Lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SalihHub/Kumru-2B-Ceza-Lora
- SGLang
How to use SalihHub/Kumru-2B-Ceza-Lora 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 "SalihHub/Kumru-2B-Ceza-Lora" \ --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": "SalihHub/Kumru-2B-Ceza-Lora", "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 "SalihHub/Kumru-2B-Ceza-Lora" \ --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": "SalihHub/Kumru-2B-Ceza-Lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SalihHub/Kumru-2B-Ceza-Lora with Docker Model Runner:
docker model run hf.co/SalihHub/Kumru-2B-Ceza-Lora
How to use from
SGLangUse 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 "SalihHub/Kumru-2B-Ceza-Lora" \
--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": "SalihHub/Kumru-2B-Ceza-Lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'Quick Links
Kumru-2B-Ceza-LoRA
Model Açıklaması
Kumru-2B-Ceza-LoRA is a Turkish language chatbot fine-tuned using LoRA (Low-Rank Adaptation) on the Kumru-2B base model. It mimics the speech style, vocabulary, and energetic perspective of Turkish rap artist Ceza.
Key Specifications:
- Base Model: vngrs-ai/Kumru-2B
- Method: LoRA (Low-Rank Adaptation)
- Language: Turkish
- License: MIT
Eğitim Detayları
Dataset
- Source: [https://www.kaggle.com/datasets/salihdede/ceza-qa-dataset-to-applying-lora-fine-tuning/data/data/data]
- Total Examples: 2,678 Q&A pairs
- Split: 90% training / 10% validation (2,410 / 268)
- Format: ChatML
- Generated using LLM with vocabulary extracted from Ceza's lyrics via N-gram analysis
LoRA Konfigürasyonu
| Parameter | Value |
|---|---|
| rank (r) | 16 |
| lora_alpha | 32 |
| lora_dropout | 0.05 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Trainable Parameters | ~1-2% |
Eğitim Parametreleri
| Parameter | Value |
|---|---|
| Max Epochs | 10 |
| Early Stopping | 3 eval patience |
| Batch Size | 8 |
| Gradient Accumulation | 2 |
| Effective Batch Size | 16 |
| Learning Rate | 2e-4 |
| LR Scheduler | Cosine |
| Warmup Steps | 50 |
| Optimizer | paged_adamw_32bit |
| Precision | BF16 |
| Quantization | 4-bit (NF4) |
Eğitim Sonuçları
| Step | Training Loss | Validation Loss |
|---|---|---|
| 50 | 0.7135 | 0.5091 |
| 100 | 0.4331 | 0.3977 |
| 150 | 0.4004 | 0.3734 |
| 200 | 0.3571 | 0.3643 |
| 250 | 0.3592 | 0.3567 |
| 300 | 0.3482 | 0.3492 |
En İyi Model: Step 300 (eval_loss: 0.3492)
Kurulum
pip install transformers peft torch accelerate
Kullanım
Inference Kodu
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Base model ve tokenizer
base_model_name = "vngrs-ai/Kumru-2B"
lora_adapter = "SalihHub/Kumru-2B-Ceza-LoRA"
# Tokenizer (base model'den)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
# Base model
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.float16,
device_map="auto"
)
# LoRA adapter'ı yükle
model = PeftModel.from_pretrained(model, lora_adapter)
model.eval()
# Chat fonksiyonu
def chat_with_ceza(question, max_new_tokens=200):
system_prompt = """Sen Ceza'sin. Turkiye'nin en etkili ve teknik rap sanatcilarindan birisin.
Hizli flow'un, sosyal elestirili sozlerin ve guclu sahne performansinla taninan bir MC'sin.
Politik ve toplumsal konularda fikirlerini acikca soyleyen, enerjik ve korkusuz bir karakterin var."""
prompt = f"""<|im_start|>system
{system_prompt}
<|im_end|>
<|im_start|>user
{question}
<|im_end|>
<|im_start|>assistant
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
if "token_type_ids" in inputs:
del inputs["token_type_ids"]
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
temperature=0.7,
top_p=0.9,
do_sample=True,
repetition_penalty=1.2,
pad_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=False)
answer = response.split("<|im_start|>assistant\n")[-1].split("<|im_end|>")[0].strip()
return answer
# Örnek kullanım
print(chat_with_ceza("Bugün nasılsın?"))
Örnek Çıktılar
| Question | Response |
|---|---|
| "Hangi Osmanlı padişahı olmak isterdin, neden?" | "Fatih Sultan Mehmet olmak isterdim; o çağları yakan zeka ve güçle, dünyaya şekil verecek bir miras bırakmak için." |
| "3 + 7 kaç yapar?" | "3 + 7 = 10 eder, tam kafa rahat!" |
| "Bir pizza olsan üstünde ne olurdu?" | "Pizzada domates sosu, ince dilimlenmiş mozarella peyniri ve taze fesleğen – üstünde erimiş peynirle dans eden güneş gibi parıldardım be!" |
Atıf
@misc{kumru-ceza-lora,
author = {Salih Dede},
title = {Kumru-2B-Ceza-LoRA: Ceza Style Turkish Chatbot},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/SalihHub/Kumru-2B-Ceza-LoRA}}
}
Acknowledgments
- VNGRS AI - Kumru 2B base model için
- Ceza - İlham kaynağı için
- Downloads last month
- 1
Model tree for SalihHub/Kumru-2B-Ceza-Lora
Base model
vngrs-ai/Kumru-2B
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SalihHub/Kumru-2B-Ceza-Lora" \ --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": "SalihHub/Kumru-2B-Ceza-Lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'