Instructions to use tugrulkaya/datalora-mistral-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tugrulkaya/datalora-mistral-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tugrulkaya/datalora-mistral-7b")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tugrulkaya/datalora-mistral-7b", device_map="auto") - PEFT
How to use tugrulkaya/datalora-mistral-7b with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tugrulkaya/datalora-mistral-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tugrulkaya/datalora-mistral-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tugrulkaya/datalora-mistral-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tugrulkaya/datalora-mistral-7b
- SGLang
How to use tugrulkaya/datalora-mistral-7b 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 "tugrulkaya/datalora-mistral-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tugrulkaya/datalora-mistral-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "tugrulkaya/datalora-mistral-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tugrulkaya/datalora-mistral-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tugrulkaya/datalora-mistral-7b with Docker Model Runner:
docker model run hf.co/tugrulkaya/datalora-mistral-7b
DATALORA: Dynamic Adaptive Token-Level Optimization with Rank-Adaptive LoRA
Mistral-7B base model (~7B parametre) üzerine uygulanan, üç yeniliği tek bir çerçevede birleştiren verimli fine-tuning yöntemi.
DATALORA, büyük dil modellerini daha az hesapla fine-tune etmek için geliştirilen üç bileşenli bir eğitim optimizasyonu yöntemidir:
- Unified Saliency Network (USN) — Ortak token önem skorlama ve uzman yönlendirmesi
- Mixture of LoRA Experts — Dinamik yönlendirilen 8 özelleşmiş LoRA adaptörü
- Dynamic Token Pruning — Müfredat tabanlı token tutma zamanlaması
Özet
| Özellik | Değer |
|---|---|
| Base model | mistralai/Mistral-7B-v0.3 |
| Parametre (base) | ~7B |
| Eğitilebilir parametre | LoRA adaptörleri (~%1'den az) |
| Yöntem | DATALORA (USN + MoLoRA + Token Pruning) |
| Eğitim verisi | Open-Orca/OpenOrca (5K örnek) |
| LoRA uzman sayısı | 8 |
| LoRA rank | 16 |
| Hedef token tutma | %50 |
| Quantization | 4-bit (NF4) |
| Eğitim epoch | 3 |
| Müfredat | Warmup → Sparsification → Hardening |
Mimari
Input Tokens
│
▼
┌─────────────────────────────┐
│ Unified Saliency Network │
│ (Shared backbone) │
├──────┬──────────┬───────────┤
│Token │ Router │ Rank │
│Scores│ Logits │ Scale │
└──┬───┴────┬─────┴─────┬─────┘
│ │ │
▼ ▼ ▼
Token Expert Dynamic
Pruning Selection Rank Scaling
│ │ │
▼ ▼ ▼
┌─────────────────────────────┐
│ Mixture of LoRA Experts │
│ (8 specialized adapters) │
└─────────────────────────────┘
Temel Fikir
Token önemi ve görev zorluğu ilişkili sinyallerdir. Karmaşık girdiler hem daha fazla token hem daha güçlü adaptasyon ister. USN bu ilişkiyi birlikte öğrenerek:
- Verimli hesap — önemsiz tokenları atla
- Uzmanlaşmış adaptasyon — farklı girdiler için farklı uzmanlar
- Uyarlanır kapasite — daha zor girdiler için daha yüksek rank
Eğitim Detayları
3 Fazlı Müfredat
- Warmup (Epoch 1): Yoğun eğitim, yüksek sıcaklık (yumuşak kararlar), tüm tokenlar tutulur
- Sparsification (Epoch 2): Token pruning kademeli artar, sıcaklık azalır
- Hardening (Epoch 3): Düşük sıcaklık (ayrık kararlar), hedef %50 tutma
Loss Fonksiyonu
L_total = L_LM + λ_prune · L_retention + α_balance · L_balance
| Terim | Amacı |
|---|---|
L_LM |
Standart dil modelleme kaybı |
L_retention |
Hedef token tutma oranını sağlar |
L_balance |
Uzmanlar arası dengeli kullanımı teşvik eder |
Kullanım
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tugrulkaya/datalora-mistral-7b")
model = AutoModelForCausalLM.from_pretrained(
"tugrulkaya/datalora-mistral-7b",
torch_dtype=torch.bfloat16,
device_map="auto",
)
prompt = "What is machine learning?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200,
temperature=0.7,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
DATALORA Çerçevesi
Kendi DATALORA modellerinizi eğitmek için çerçevenin bileşenleri:
- UnifiedSaliencyNetwork — Ortak token skorlama + uzman yönlendirme + rank ölçekleme
- SimpleMixtureOfExperts — 8 LoRA uzmanı, ağırlıklı birleştirme
- CurriculumScheduler — 3 fazlı sıcaklık zamanlaması
- DATALORATrainer — Müfredatla genişletilmiş HF Trainer
Örnek Konfigürasyon
from models import DATALORAConfig
config = DATALORAConfig(
base_model="mistralai/Mistral-7B-v0.3",
num_lora_experts=8,
lora_rank=16,
lora_alpha=32,
target_retention=0.5,
num_active_experts=2,
temperature_init=5.0,
temperature_final=0.5,
)
Atıf
@misc{kaya2025datalora,
title = {DATALORA: Dynamic Adaptive Token-Level Optimization with Rank-Adaptive LoRA},
author = {Kaya, Tuğrul},
year = {2025},
url = {https://huggingface.co/tugrulkaya/datalora-mistral-7b}
}
Lisans
Apache 2.0 (Mistral-7B-v0.3'ten devralınmıştır)
Model tree for tugrulkaya/datalora-mistral-7b
Base model
mistralai/Mistral-7B-v0.3