Instructions to use yusufbaykaloglu/Turkish-University-Regulations with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yusufbaykaloglu/Turkish-University-Regulations with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yusufbaykaloglu/Turkish-University-Regulations") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yusufbaykaloglu/Turkish-University-Regulations") model = AutoModelForCausalLM.from_pretrained("yusufbaykaloglu/Turkish-University-Regulations", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yusufbaykaloglu/Turkish-University-Regulations with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yusufbaykaloglu/Turkish-University-Regulations" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yusufbaykaloglu/Turkish-University-Regulations", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yusufbaykaloglu/Turkish-University-Regulations
- SGLang
How to use yusufbaykaloglu/Turkish-University-Regulations 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 "yusufbaykaloglu/Turkish-University-Regulations" \ --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": "yusufbaykaloglu/Turkish-University-Regulations", "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 "yusufbaykaloglu/Turkish-University-Regulations" \ --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": "yusufbaykaloglu/Turkish-University-Regulations", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yusufbaykaloglu/Turkish-University-Regulations with Docker Model Runner:
docker model run hf.co/yusufbaykaloglu/Turkish-University-Regulations
Model Details
Model Description
his model is based on the ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1 base model and has been fine-tuned on a Turkish Q&A dataset concerning university regulations. The fine-tuning was performed using the LoRA method with 4-bit quantization via BitsAndBytes to reduce memory footprint while preserving performance. The training data, sourced from the dataset yusufbaykaloglu/University_Mevzuat_QA_v2, contains question–answer pairs formatted as follows:
<s>[INST] {question} [/INST] {answer}</s>
- Developed by: [Yusuf Baykaloğlu]
- Model type: [Causal Language Model fine-tuned with LoRA]
- Language(s) (NLP): [Turkish]
- Finetuned from model: [ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1]
How to Get Started with the Model
Below is a sample code snippet to get started with the model:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "yusufbaykaloglu/Turkish-University-Regulations"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name)
model.to(device)
input_text = "<s>[INST] Sorunuzu giriniz. [/INST]<s>"
inputs = tokenizer(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs["input_ids"], max_length=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Example
input_text = "<s>[INST] Dokuz Eylül Üniversitesi Fen Fakültesi öğrencisiyim. İngilizce hazırlık programından muaf olmak veya doğrudan atlamak için hangi şartları sağlamam gerekiyor? [/INST]<s>"
<s>[INST] Dokuz Eylül Üniversitesi Fen Fakültesi öğrencisiyim. İngilizce hazırlık programından muaf olmak veya doğrudan atlamak için hangi şartları sağlamam gerekiyor?
[/INST]<s>Madde 6'ya göre, İngilizce hazırlık programından muaf olmak veya doğrudan atlamak için aşağıdaki şartları sağlamanız gerekiyor:
1. **Yabancı Dil Yeterlik Sınavı:** Yabancı dil yeterliliğinizi kanıtlamak için Yabancı Dil Yeterlik Sınavı'na girmelisiniz.
2. **Yeterlik Notu:** Sınavda belirli bir not almanız gerekiyor. Bu not, İngilizce hazırlık programından muafiyet veya atlamayı sağlayacak düzeyde belirlenmiştir.
3. **Muafiyet veya Atlamayı Başvurma:** Sınav sonuçlarınızı ve gerekli belgeleri, fakültenin belirlediği prosedürlere uygun olarak Öğrenci İşleri Daire Başkanlığına sunmanız gerekir.
4. **Onay:** Öğrenci İşleri Daire Başkanlığı, başvurunuzu inceleyecek ve muafiyet veya atlamayı onaylayacaktır.
Bias, Risks, and Limitations
This model has been trained on a specific Q&A dataset related to Turkish university regulations and may reflect inherent biases or gaps present in the source data. Users should be aware that:
- Generated responses might occasionally be incorrect, incomplete, or outdated.
- The model is best used as an assistive tool rather than a sole authority on university regulations.
Training Details
Training Data
- Source: The model was fine-tuned using the dataset yusufbaykaloglu/University_Mevzuat_QA_v2, which comprises Turkish question–answer pairs on university regulations.
Training Procedure
Base Model:
ytu-ce-cosmos/Turkish-Llama-8b-DPO-v0.1
Fine-Tuning Method:
- LoRA (Low-Rank Adaptation)
LoRA Configuration:
r = 64lora_alpha = 128lora_dropout = 0.1bias = "none"- Task type:
CAUSAL_LM
Training Framework:
- SFTTrainer from the TRL library
Training Hyperparameters:
- Epochs: 8
- Per-device Batch Size: 2
- Gradient Accumulation Steps: 16
- Learning Rate: 1e-4
- Weight Decay: 0.001
- Warmup Ratio: 0.03 (with 100 warmup steps)
- LR Scheduler: Cosine
- Max Sequence Length: 256 tokens
- Optimizer: paged_adamw_32bit
- Max Gradient Norm: 0.3
Quantization:
- 4-bit quantization using BitsAndBytes for efficient memory and compute usage
Training Loss
Below are the training loss values recorded at various training steps:
| Step | Training Loss |
|---|---|
| 500 | 1.077800 |
| 1000 | 0.866600 |
| 1500 | 0.791500 |
| 2000 | 0.736100 |
| 2500 | 0.693900 |
| 3000 | 0.658500 |
| 3500 | 0.642400 |
Contributions and Support
For any inquiries, bug reports, or collaboration requests, please contact:
- Email: Email
- Hugging Face Profile: https://huggingface.co/yusufbaykaloglu
- GitHub: yusufbaykal
- Linkedin:yusufbaykaloglu
Citation
If you use this model in your research or project, please cite it as follows:
@misc{Baykaloglu2025TurkishUniversityRegulations,
author = {Yusuf Baykaloglu},
title = {Turkish-University-Regulations: A Fine-tuned Turkish Llama Model for University Regulations Q&A},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/yusufbaykaloglu/Turkish-University-Regulations}}
}
- Downloads last month
- 9
Model tree for yusufbaykaloglu/Turkish-University-Regulations
Base model
meta-llama/Meta-Llama-3-8B