Instructions to use SykoSLM/SykoLLM-V6.9-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use SykoSLM/SykoLLM-V6.9-SFT with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
SykoLLM-V6.9-SFT
SykoLLM-V6.9-SFT, SykoSLM/SykoLLM-v6.9 temel modelinin, Alpaca formatlı bir talimat (instruction) veri seti üzerinde LoRA (Low-Rank Adaptation) yöntemiyle ince ayar yapılıp, ardından adaptör ağırlıklarının taban model ile birleştirilmesiyle (merge) elde edilmiş halidir.
Model Detayları
| Özellik | Değer |
|---|---|
| Mimari | Phi3ForCausalLM |
| Gizli katman boyutu (hidden_size) | 1024 |
| Katman sayısı (num_hidden_layers) | 24 |
| Dikkat başlığı sayısı (num_attention_heads) | 8 |
| Key/Value başlığı sayısı (num_key_value_heads) | 2 |
| Ara katman boyutu (intermediate_size) | 3072 |
| Kelime dağarcığı (vocab_size) | 50,000 |
| Maksimum pozisyon (max_position_embeddings) | 1024 |
| Aktivasyon fonksiyonu | SiLU |
| Veri tipi | float16 |
İnce Ayar (Fine-Tuning) Bilgileri
Model, taban ağırlıklar dondurulmuş şekilde yalnızca LoRA adaptör katmanları eğitilerek fine-tune edilmiştir:
trainable params: 24,379,392 || all params: 416,236,544 || trainable%: 5.8571
- Toplam parametre sayısı: ~416.2M
- Eğitilebilir (LoRA) parametre sayısı: ~24.4M
- Eğitilebilir oran: %5.86
- Yöntem: LoRA → eğitim sonrası
merge_and_unload()ile taban modele birleştirildi - Veri seti formatı: Alpaca (instruction / input / output)
Not: Yukarıdaki istatistikler yalnızca LoRA eğitim aşamasına aittir; bu repodaki ağırlıklar zaten birleştirilmiş (merged) haldedir, ayrıca bir adaptör yüklemeye gerek yoktur.
Kullanım
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "SykoSLM/SykoLLM-V6.9-SFT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
)
prompt = """### Talimat:
Türkiye'nin başkenti neresidir?
### Cevap:
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=128,
do_sample=True,
temperature=0.5,
top_p=0.9,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Karşılaştırmalı Inference Scripti (Base Model vs LoRA)
Base model ile LoRA adaptörünün yan yana karşılaştırılması için:
"""
Inference Script — SykoSLM/SykoLLM-v6.9 + LoRA Adapter
Base model ve LoRA'lı halini yan yana karşılaştırır.
Gereksinimler:
pip install transformers peft torch --break-system-packages
"""
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE_MODEL_NAME = "SykoSLM/SykoLLM-v6.9"
ADAPTER_PATH = "/kaggle/working/sykollm-lora-alpaca/final_adapter"
MAX_NEW_TOKENS = 200
TEMPERATURE = 0.5
TOP_P = 0.9
REPETITION_PENALTY = 1.0
NO_REPEAT_NGRAM_SIZE = 0
TEST_INSTRUCTIONS = [
"hello!",
"Explain what a black hole is in simple terms.",
"Write a short poem about autumn.",
"What is the capital of France?",
"Give me three tips for staying productive while working from home.",
"What is the capital of Turkey?",
]
print("Tokenizer yükleniyor...")
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME, trust_remote_code=True)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
print("Base model yükleniyor...")
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL_NAME,
trust_remote_code=True,
torch_dtype=torch.float32,
device_map="auto",
)
base_model.eval()
print("LoRA adaptörü yükleniyor...")
lora_model = PeftModel.from_pretrained(base_model, ADAPTER_PATH)
lora_model.eval()
def format_prompt(instruction, input_text=""):
if input_text:
return (
f"### Instruction:\n{instruction}\n\n"
f"### Input:\n{input_text}\n\n"
f"### Response:\n"
)
return f"### Instruction:\n{instruction}\n\n### Response:\n"
def generate(model, prompt, max_new_tokens=MAX_NEW_TOKENS):
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
temperature=TEMPERATURE,
top_p=TOP_P,
repetition_penalty=REPETITION_PENALTY,
no_repeat_ngram_size=NO_REPEAT_NGRAM_SIZE,
do_sample=True,
pad_token_id=tokenizer.pad_token_id,
)
full_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
if "### Response:" in full_text:
return full_text.split("### Response:")[-1].strip()
return full_text[len(prompt):].strip()
if __name__ == "__main__":
for instruction in TEST_INSTRUCTIONS:
prompt = format_prompt(instruction)
print("\n" + "=" * 80)
print(f"INSTRUCTION: {instruction}")
print("=" * 80)
print("\n[BASE MODEL — LoRA'sız]")
base_output = generate(base_model, prompt)
print(base_output)
print("\n[LoRA'LI MODEL]")
lora_output = generate(lora_model, prompt)
print(lora_output)
print("\n" + "=" * 80)
print("Test tamamlandı.")
Eğitim Şablonu (Alpaca Formatı)
### Talimat:
{instruction}
### Girdi:
{input}
### Cevap:
{output}
Sınırlamalar
- Model küçük ölçekli olduğu için (~416M parametre) karmaşık akıl yürütme gerektiren görevlerde sınırlı performans gösterebilir.
- Üretilen çıktılar yanlış, tutarsız veya önyargılı bilgi içerebilir; kritik kararlarda doğrulanmadan kullanılmamalıdır.
max_position_embeddingsdeğeri 1024 olduğundan çok uzun bağlamlarda kesilme yaşanabilir.
Lisans
Bu model kartında lisans olarak apache-2.0 varsayılan olarak belirtilmiştir. Taban modelin (SykoSLM/SykoLLM-v6.9) lisansına göre bu alanı güncellemeniz gerekebilir.
Atıf
@misc{sykollm-v69-sft,
title = {SykoLLM-V6.9-SFT},
author = {SykoSLM},
year = {2026},
note = {LoRA fine-tuned and merged from SykoSLM/SykoLLM-v6.9}
}
- Downloads last month
- -
Model tree for SykoSLM/SykoLLM-V6.9-SFT
Base model
SykoSLM/SykoLLM-v6.9