Instructions to use Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tuguberk/Qwen3.5-2B-Turkish-SFT-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": "Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA
- SGLang
How to use Tuguberk/Qwen3.5-2B-Turkish-SFT-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 "Tuguberk/Qwen3.5-2B-Turkish-SFT-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": "Tuguberk/Qwen3.5-2B-Turkish-SFT-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 "Tuguberk/Qwen3.5-2B-Turkish-SFT-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": "Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA", max_seq_length=2048, ) - Docker Model Runner
How to use Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA with Docker Model Runner:
docker model run hf.co/Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA
Qwen3.5-2B-Turkish-SFT — LoRA Adaptörleri
Bu repo, Tuguberk/Qwen3.5-2B-Turkish-SFT modelinin sadece LoRA adaptörlerini içerir. Merged (birleştirilmiş) modeli kullanmak istiyorsanız ana repoya gidin.
LoRA nedir?
LoRA (Low-Rank Adaptation), modelin tüm ağırlıklarını değiştirmek yerine küçük adaptör katmanları ekleyerek fine-tuning yapan bir yöntemdir. Bu repo sadece o adaptörleri (~100MB) içerir — base modeli ayrıca indirmeniz gerekir.
Adaptör Detayları
| Base model | unsloth/Qwen3.5-2B |
| LoRA rank | 16 |
| LoRA alpha | 16 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Eğitilebilir parametre | 16,819,200 / 2,230,060,864 (%0.75) |
| Dataset | AlicanKiraz0/Turkish-SFT-Dataset-v1.0 |
| Epoch | 3 |
| Training loss | 1.47 → 0.82 |
Kullanım
from transformers import AutoModelForCausalLM, AutoProcessor
from peft import PeftModel
import torch
base_model_name = "unsloth/Qwen3.5-2B"
lora_model_name = "Tuguberk/Qwen3.5-2B-Turkish-SFT-LoRA"
# Base modeli yükle
processor = AutoProcessor.from_pretrained(base_model_name)
tokenizer = processor.tokenizer
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# LoRA adaptörlerini üstüne ekle
model = PeftModel.from_pretrained(model, lora_model_name)
model.eval()
# Kullanım
messages = [
{"role": "system", "content": "Sen yardımcı bir Türkçe asistansın."},
{"role": "user", "content": "Yapay zeka nedir?"},
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(
inputs["input_ids"],
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(response)
Ne zaman LoRA, ne zaman merged model kullanılır?
| LoRA (bu repo) | Merged model | |
|---|---|---|
| Dosya boyutu | ~100MB | ~4.5GB |
| Base model gerekli mi? | ✅ Evet | ❌ Hayır |
| Ollama / llama.cpp | ❌ Çalışmaz | ✅ Çalışır |
| Araştırma / deney | ✅ İdeal | — |
| Production kullanım | — | ✅ İdeal |
Çoğu kullanım için merged modeli tercih edin: Tuguberk/Qwen3.5-2B-Turkish-SFT
Lisans
Apache 2.0 — base model lisansıyla aynıdır.
