esrt/yksuniform
Viewer • Updated • 1.85k • 36 • 2
How to use Huseyin/yks-turkish-7b-lora with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Huseyin/yks-turkish-7b-lora")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Huseyin/yks-turkish-7b-lora", dtype="auto")How to use Huseyin/yks-turkish-7b-lora with PEFT:
Task type is invalid.
How to use Huseyin/yks-turkish-7b-lora with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Huseyin/yks-turkish-7b-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": "Huseyin/yks-turkish-7b-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/Huseyin/yks-turkish-7b-lora
How to use Huseyin/yks-turkish-7b-lora with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Huseyin/yks-turkish-7b-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": "Huseyin/yks-turkish-7b-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "Huseyin/yks-turkish-7b-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": "Huseyin/yks-turkish-7b-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use Huseyin/yks-turkish-7b-lora with Docker Model Runner:
docker model run hf.co/Huseyin/yks-turkish-7b-lora
Türkiye YKS (TYT/AYT) sınavlarına özel fine-tune edilmiş Türkçe eğitim modeli. TRUBA H200 GPU kullanılarak 1854 gerçek YKS sorusu ile eğitilmiştir.
| Ders | Başarı Oranı | Soru Sayısı |
|---|---|---|
| TYT Matematik | %75 | 168 |
| AYT Matematik | %60 | 144 |
| AYT Tarih | %65 | 156 |
| Fizik | %55 | 132 |
| Kimya | %50 | 90 |
| Biyoloji | %50 | 114 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import torch
# 4-bit config (opsiyonel, bellek tasarrufu için)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.float16
)
# Model yükleme
base_model = "Qwen/Qwen2.5-7B-Instruct"
model = AutoModelForCausalLM.from_pretrained(
base_model,
quantization_config=bnb_config, # Opsiyonel
device_map="auto"
)
# LoRA adapter yükle
model = PeftModel.from_pretrained(model, "Huseyin/yks-turkish-7b-lora")
tokenizer = AutoTokenizer.from_pretrained("Huseyin/yks-turkish-7b-lora")
# Soru çözme
def yks_coz(soru):
prompt = f"""Sen bir YKS uzmanısın. Soruyu çöz ve Türkçe açıkla.
Soru: {soru}
Çözüm:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=300,
temperature=0.7,
do_sample=True,
top_p=0.9
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Test
print(yks_coz("x² - 5x + 6 = 0 denkleminin kökleri nelerdir?"))
sorular = [
"2x + 5 = 15 denklemini çöz",
"Pisagor teoremini açıkla",
"Mitoz ve mayoz arasındaki farklar nelerdir?",
"Osmanlı Devleti'nin kuruluş tarihi nedir?"
]
for soru in sorular:
cevap = yks_coz(soru)
print(f"S: {soru}")
print(f"C: {cevap}\n")
Soru ve öneriler için GitHub Issues veya Discussions kullanabilirsiniz.
Not: Bu model eğitim amaçlıdır. Gerçek sınav hazırlığında mutlaka uzman desteği alınmalıdır.
Developed with ❤️ for Turkish students